[libc] Switch to use a macro which does not insert a section for every libc function. (details)
Commit
daaaed6bb89044ac58a23f1bb1ccdd12342a5a58
by jezng
[lld-macho] Fix TLV data initialization
We were mishandling the case where both `__tbss` and `__thread_data` sections were present.
TLVP relocations should be encoded as offsets from the start of `__thread_data`, even if the symbol is actually located in `__thread_bss`. Previously, we were writing the offset from the start of the containing section, which doesn't really make sense since there's no way `tlv_get_addr()` can know which section a given `tlv$init` symbol is in at runtime.
In addition, this patch ensures that we place `__thread_data` immediately before `__thread_bss`. This is what ld64 does, likely for performance reasons. Zerofill sections must also be at the end of their segments; we were already doing this, but now we ensure that `__thread_bss` occurs before `__bss`, so that it's always possible to have it contiguous with `__thread_data`.
Commit
a0b65a7bcd6065688189b3d678c42ed6af9603db
by michaelrj
[libc] Switch to use a macro which does not insert a section for every libc function.
Summary: The new macro also inserts the C alias for the C++ implementations without needing an objcopy based post processing step. The CMake rules have been updated to reflect this. More CMake cleanup can be taken up in future rounds and appropriate TODOs have been added for them.