summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Driver.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-01-24 03:41:20 +0000
committerRui Ueyama <ruiu@google.com>2017-01-24 03:41:20 +0000
commitb2a23cf3c08cee45614f27eb2c6d044e506aa6a6 (patch)
treeb5a39d198e1afea7aa31d0db136cd674940f9328 /lld/ELF/Driver.cpp
parenteb440a14a56f3b40ab6881adfe0665d53722af7d (diff)
downloadbcm5719-llvm-b2a23cf3c08cee45614f27eb2c6d044e506aa6a6.tar.gz
bcm5719-llvm-b2a23cf3c08cee45614f27eb2c6d044e506aa6a6.zip
Do not allocate space for common symbols with -r
Currently ld.lld -r allocates space for common symbols, whereas ld.bfd -r doesn't. As a result the OpenBSD makefile bits for creating libraries fail as they use ld -X -r to strip local symbols, which results in duplicate symbol errors because space for the common symbols has been allocated. The diff also implements the --define-commons option such that allocation of commons can be forced even if -r is used. Patch by Mark Kettenis. llvm-svn: 292878
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r--lld/ELF/Driver.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index eeda973daae..b6b417e8665 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -498,6 +498,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->Pie = getArg(Args, OPT_pie, OPT_nopie, false);
Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections);
Config->Relocatable = Args.hasArg(OPT_relocatable);
+ Config->DefineCommon = getArg(Args, OPT_define_common, OPT_no_define_common,
+ !Config->Relocatable);
Config->Discard = getDiscardOption(Args);
Config->SaveTemps = Args.hasArg(OPT_save_temps);
Config->SingleRoRx = Args.hasArg(OPT_no_rosegment);
OpenPOWER on IntegriCloud