[PATCH] Proper whole-archive handling
Joerg Sonnenberger
joerg at NetBSD.org
Tue Sep 3 14:19:11 PDT 2013
Hi Bigcheese, rui314, shankarke,
The patch passes the LinkerInput instance down the parseFile/readFile chain to make positional flags possible. It uses this to replace the global forceLoadAllArchive flag with per-input isWholeArchive.
The Darwin option is emulated by setting the flag for all inputs when present. The option -all_load in GNU mode is dropped.
The patch assumes that linker scripts and libraries should inherit the positional flag. At the moment it is not possible to specify flags in linker scripts, so this seems to be an acceptable restriction.
Test case will follow, but I want to get the API change sorted out first.
http://llvm-reviews.chandlerc.com/D1587
Files:
test/elf/archive-elf-forceload.test
include/lld/Core/LinkingContext.h
include/lld/Driver/LinkerInput.h
include/lld/Driver/DarwinInputGraph.h
include/lld/ReaderWriter/MachOLinkingContext.h
include/lld/ReaderWriter/CoreLinkingContext.h
include/lld/ReaderWriter/PECOFFLinkingContext.h
include/lld/ReaderWriter/ELFLinkingContext.h
include/lld/ReaderWriter/ReaderLinkerScript.h
include/lld/ReaderWriter/Reader.h
include/lld/ReaderWriter/ReaderArchive.h
docs/Readers.rst
unittests/DriverTests/DarwinLdDriverTest.cpp
lib/Core/LinkingContext.cpp
lib/Driver/DarwinLdDriver.cpp
lib/Driver/GnuLdDriver.cpp
lib/Driver/Driver.cpp
lib/Driver/LDOptions.td
lib/ReaderWriter/ELF/Reader.cpp
lib/ReaderWriter/ELF/ELFLinkingContext.cpp
lib/ReaderWriter/ReaderLinkerScript.cpp
lib/ReaderWriter/Reader.cpp
lib/ReaderWriter/ReaderArchive.cpp
lib/ReaderWriter/Native/ReaderNative.cpp
lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lib/ReaderWriter/CoreLinkingContext.cpp
lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1587.1.patch
Type: text/x-patch
Size: 26092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/d95bd8aa/attachment.bin>
More information about the llvm-commits
mailing list