SuccessChanges

Summary

  1. [lld-macho] Fix TLV data initialization (details)
  2. [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`.

Fixes llvm.org/PR48657.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D94329
The file was modifiedlld/MachO/Writer.h
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/test/MachO/bss.s
The file was modifiedlld/MachO/InputSection.h
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/test/MachO/tlv.s
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.

Reviewers: mcgrathr, sivachandra

Subscribers:
The file was modifiedlibc/src/ctype/isblank.cpp
The file was modifiedlibc/src/math/nearbyint.cpp
The file was modifiedlibc/src/signal/linux/raise.cpp
The file was modifiedlibc/src/math/nearbyintl.cpp
The file was modifiedlibc/src/math/fmaxf.cpp
The file was modifiedlibc/src/math/logb.cpp
The file was modifiedlibc/src/math/logbl.cpp
The file was modifiedlibc/src/signal/linux/sigdelset.cpp
The file was modifiedlibc/src/ctype/tolower.cpp
The file was modifiedlibc/src/math/modff.cpp
The file was modifiedlibc/src/math/lroundf.cpp
The file was modifiedlibc/src/string/memchr.cpp
The file was modifiedlibc/src/math/ilogb.cpp
The file was modifiedlibc/src/math/sqrt.cpp
The file was modifiedlibc/src/math/exp2f.cpp
The file was modifiedlibc/src/signal/linux/signal.cpp
The file was modifiedlibc/src/string/strcpy.cpp
The file was modifiedlibc/src/string/strcat.cpp
The file was modifiedlibc/src/math/remquo.cpp
The file was modifiedlibc/src/fenv/feclearexcept.cpp
The file was modifiedlibc/src/math/hypotf.cpp
The file was modifiedlibc/src/math/remquof.cpp
The file was modifiedlibc/src/math/remainderf.cpp
The file was modifiedlibc/src/threads/linux/call_once.cpp
The file was modifiedlibc/src/math/frexpl.cpp
The file was modifiedlibc/src/string/memrchr.cpp
The file was modifiedlibc/src/sys/mman/linux/munmap.cpp
The file was modifiedlibc/src/math/trunc.cpp
The file was modifiedlibc/src/math/copysignl.cpp
The file was modifiedlibc/src/ctype/isdigit.cpp
The file was modifiedlibc/src/string/strstr.cpp
The file was modifiedlibc/src/string/strncpy.cpp
The file was modifiedlibc/src/signal/linux/sigfillset.cpp
The file was modifiedlibc/src/stdlib/llabs.cpp
The file was modifiedlibc/src/math/fdimf.cpp
The file was modifiedlibc/src/math/lroundl.cpp
The file was modifiedlibc/src/math/llrint.cpp
The file was modifiedlibc/src/ctype/isalpha.cpp
The file was modifiedlibc/src/math/ldexpl.cpp
The file was modifiedlibc/src/math/rint.cpp
The file was modifiedlibc/src/math/copysign.cpp
The file was modifiedlibc/src/math/fdiml.cpp
The file was modifiedlibc/cmake/modules/LLVMLibCObjectRules.cmake
The file was modifiedlibc/src/signal/linux/sigaddset.cpp
The file was modifiedlibc/src/string/strspn.cpp
The file was modifiedlibc/src/math/lrintf.cpp
The file was modifiedlibc/src/ctype/isxdigit.cpp
The file was modifiedlibc/src/string/memcmp.cpp
The file was modifiedlibc/src/math/fabs.cpp
The file was modifiedlibc/src/signal/linux/sigprocmask.cpp
The file was modifiedlibc/src/__support/common.h.def
The file was modifiedlibc/src/ctype/isgraph.cpp
The file was modifiedlibc/src/ctype/iscntrl.cpp
The file was modifiedlibc/src/math/floorl.cpp
The file was modifiedlibc/src/string/strnlen.cpp
The file was modifiedlibc/src/ctype/isprint.cpp
The file was modifiedlibc/src/math/sincosf.cpp
The file was modifiedlibc/src/ctype/isalnum.cpp
The file was modifiedlibc/src/math/fminl.cpp
The file was modifiedlibc/src/ctype/ispunct.cpp
The file was modifiedlibc/src/math/truncl.cpp
The file was modifiedlibc/src/math/nextafterf.cpp
The file was modifiedlibc/src/signal/linux/sigaction.cpp
The file was modifiedlibc/src/string/memcpy.cpp
The file was modifiedlibc/src/stdlib/abort.cpp
The file was modifiedlibc/src/fenv/feraiseexcept.cpp
The file was modifiedlibc/src/math/lrintl.cpp
The file was modifiedlibc/src/string/strcmp.cpp
The file was modifiedlibc/src/math/nextafter.cpp
The file was modifiedlibc/src/string/strchr.cpp
The file was modifiedlibc/src/unistd/linux/write.cpp
The file was modifiedlibc/src/threads/linux/thrd_create.cpp
The file was modifiedlibc/src/math/llround.cpp
The file was modifiedlibc/src/math/ceil.cpp
The file was modifiedlibc/src/math/llroundl.cpp
The file was modifiedlibc/src/math/rintl.cpp
The file was modifiedlibc/src/math/round.cpp
The file was modifiedlibc/src/string/memset.cpp
The file was modifiedlibc/src/threads/linux/mtx_lock.cpp
The file was modifiedlibc/src/time/mktime.cpp
The file was modifiedlibc/src/math/llroundf.cpp
The file was modifiedlibc/src/math/lrint.cpp
The file was modifiedlibc/src/threads/linux/mtx_unlock.cpp
The file was modifiedlibc/src/math/fdim.cpp
The file was modifiedlibc/src/math/fminf.cpp
The file was modifiedlibc/src/math/remainderl.cpp
The file was modifiedlibc/src/string/strpbrk.cpp
The file was modifiedlibc/src/math/fmaxl.cpp
The file was modifiedlibc/src/math/frexpf.cpp
The file was modifiedlibc/src/fenv/fetestexcept.cpp
The file was modifiedlibc/src/fenv/fegetround.cpp
The file was modifiedlibc/src/math/fabsl.cpp
The file was modifiedlibc/src/string/strtok_r.cpp
The file was modifiedlibc/src/math/ldexpf.cpp
The file was modifiedlibc/src/threads/linux/thrd_join.cpp
The file was modifiedlibc/src/string/x86/memcpy.cpp
The file was modifiedlibc/src/ctype/islower.cpp
The file was modifiedlibc/src/math/copysignf.cpp
The file was modifiedlibc/src/math/floor.cpp
The file was modifiedlibc/src/string/bzero.cpp
The file was modifiedlibc/src/math/ceilf.cpp
The file was modifiedlibc/src/math/lround.cpp
The file was modifiedlibc/src/math/logbf.cpp
The file was modifiedlibc/src/ctype/isspace.cpp
The file was modifiedlibc/src/math/ldexp.cpp
The file was modifiedlibc/src/math/expf.cpp
The file was modifiedlibc/src/sys/mman/linux/mmap.cpp
The file was modifiedlibc/src/stdlib/linux/_Exit.cpp
The file was modifiedlibc/src/stdlib/abs.cpp
The file was modifiedlibc/src/string/strtok.cpp
The file was modifiedlibc/src/math/modfl.cpp
The file was modifiedlibc/src/math/fabsf.cpp
The file was modifiedlibc/src/threads/linux/mtx_init.cpp
The file was modifiedlibc/src/math/nextafterl.cpp
The file was modifiedlibc/src/string/strlen.cpp
The file was modifiedlibc/src/signal/linux/sigemptyset.cpp
The file was modifiedlibc/src/math/fmax.cpp
The file was modifiedlibc/src/assert/__assert_fail.cpp
The file was modifiedlibc/src/math/truncf.cpp
The file was modifiedlibc/src/math/sinf.cpp
The file was modifiedlibc/src/math/floorf.cpp
The file was modifiedlibc/src/stdlib/labs.cpp
The file was modifiedlibc/src/math/rintf.cpp
The file was modifiedlibc/src/math/llrintl.cpp
The file was modifiedlibc/src/math/ceill.cpp
The file was modifiedlibc/src/math/modf.cpp
The file was modifiedlibc/src/math/remquol.cpp
The file was modifiedlibc/src/string/strrchr.cpp
The file was modifiedlibc/src/math/llrintf.cpp
The file was modifiedlibc/src/math/nearbyintf.cpp
The file was modifiedlibc/src/errno/__errno_location.cpp
The file was modifiedlibc/src/math/fmaf.cpp
The file was modifiedlibc/src/math/roundf.cpp
The file was modifiedlibc/src/ctype/isupper.cpp
The file was modifiedlibc/src/ctype/toupper.cpp
The file was modifiedlibc/src/math/ilogbf.cpp
The file was modifiedlibc/src/math/sqrtf.cpp
The file was modifiedlibc/src/math/hypot.cpp
The file was modifiedlibc/src/math/cosf.cpp
The file was modifiedlibc/src/math/frexp.cpp
The file was modifiedlibc/src/math/ilogbl.cpp
The file was modifiedlibc/src/math/fmin.cpp
The file was modifiedlibc/src/math/roundl.cpp
The file was modifiedlibc/src/math/sqrtl.cpp
The file was modifiedlibc/src/string/strcspn.cpp
The file was modifiedlibc/src/fenv/fesetround.cpp
The file was modifiedlibc/src/math/remainder.cpp