ELF: Only add libcall symbols to the link if defined in bitcode.
Adding all libcall symbols to the link can have undesired consequences. For example, the libgcc implementation of __sync_val_compare_and_swap_8 on 32-bit ARM pulls in an .init_array entry that aborts the program if the Linux kernel does not support 64-bit atomics, which would prevent the program from running even if it does not use 64-bit atomics. This change makes it so that we only add libcall symbols to the link before LTO if we have to, i.e. if the symbol's definition is in bitcode. Any other required libcall symbols will be added to the link after LTO when we add the LTO object file to the link. Differential Revision: https://reviews.llvm.org/D50475 llvm-svn: 339301
Showing
- lld/ELF/Driver.cpp 30 additions, 3 deletionslld/ELF/Driver.cpp
- lld/ELF/Symbols.cpp 9 additions, 0 deletionslld/ELF/Symbols.cpp
- lld/ELF/Symbols.h 1 addition, 0 deletionslld/ELF/Symbols.h
- lld/test/ELF/lto/Inputs/libcall-archive.s 2 additions, 0 deletionslld/test/ELF/lto/Inputs/libcall-archive.s
- lld/test/ELF/lto/libcall-archive.ll 5 additions, 1 deletionlld/test/ELF/lto/libcall-archive.ll
Loading
Please register or sign in to comment