The addend for PT_TLS p_vaddr value should be obj' relocbase and not mapbase. It does not matter for dso which is linked at the address zero, but for executables with non-zero link address mapbase is normally already at the link base. Then adding mapbase to phtls->p_vaddr adds twice as much relocbase offset as needed. PR: 288334 Reported by: Jordan Gordeev <jgopensource@proton.me>
Details
Details
- Reviewers
jrtc27 jhb markj - Commits
- rGdb9ef9d5f517: rtld: do not relocate tlsinit address twice
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Please note in the commit message that this is specific to direct exec; I was initially confused how this was broken for so long without noticing as PDEs with TLS aren't that rare, especially prior to WITH_PIE being the default.