mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-26 05:56:12 +00:00
7f80f1bbf5
Summary: The linker needs to be able to determine whether a symbol is text or data to handle the case of a common being overridden by a strong definition in an archive. If the archive contains a text member of the same name as the common, that function is discarded. However, if the archive contains a data member of the same name, that strong definition overrides the common. This is a behavior of ld.bfd, which the Qualcomm linker also supports in LTO. Here's a test case to illustrate: #### cat > 1.c << \! int blah; ! cat > 2.c << \! int blah() { return 0; } ! cat > 3.c << \! int blah = 20; ! clang -c 1.c clang -c 2.c clang -c 3.c ar cr lib.a 2.o 3.o ld 1.o lib.a -t #### The correct output is: 1.o (lib.a)3.o Thanks to Shankar Easwaran and Hemant Kulkarni for the test case! Reviewers: mehdi_amini, rafael, pcc, davide Reviewed By: pcc Subscribers: davide, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D31901 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300205 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
Archive.cpp | ||
ArchiveWriter.cpp | ||
Binary.cpp | ||
CMakeLists.txt | ||
COFFObjectFile.cpp | ||
Decompressor.cpp | ||
ELF.cpp | ||
ELFObjectFile.cpp | ||
Error.cpp | ||
IRObjectFile.cpp | ||
IRSymtab.cpp | ||
LLVMBuild.txt | ||
MachOObjectFile.cpp | ||
MachOUniversal.cpp | ||
ModuleSummaryIndexObjectFile.cpp | ||
ModuleSymbolTable.cpp | ||
Object.cpp | ||
ObjectFile.cpp | ||
RecordStreamer.cpp | ||
RecordStreamer.h | ||
SymbolicFile.cpp | ||
SymbolSize.cpp | ||
WasmObjectFile.cpp |