[lld/mac] Make sure __thread_ptrs is in front of __thread_bss
authorNico Weber <thakis@chromium.org>
Sat, 19 Jun 2021 14:55:48 +0000 (10:55 -0400)
committerNico Weber <thakis@chromium.org>
Sat, 19 Jun 2021 16:56:43 +0000 (12:56 -0400)
commitc931e12b1d517ca2d0b1dbcb90f65b770046ef3e
tree2a7355376cba216a1dda5200991812f1be70bcff
parent17271ece0da69c4dde0bbab60883b7fdd05be131
[lld/mac] Make sure __thread_ptrs is in front of __thread_bss

The exact location doesn't matter, but it should be in front
of __thread_bss. We put it right in front of __thread_data
which is where ld64 seems to put it as well.

Fixes PR50769.

(As mentioned on the bug, there is probably a more structural
fix too, see comment 5. If we don't address this, it's likely
we'll run into this again with other synthetic sections. But
for now, let's fix the immediate breakage.)

Differential Revision: https://reviews.llvm.org/D104596
lld/MachO/OutputSegment.cpp
lld/test/MachO/tlv-dylib.s