diff options
| author | Shankar Easwaran <shankarke@gmail.com> | 2014-04-02 03:57:37 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankarke@gmail.com> | 2014-04-02 03:57:37 +0000 |
| commit | a00abba152026a357adb4dfdd79d05a124b330b9 (patch) | |
| tree | 188065ca78aaeb1610ba21b9ea8e6da71585b1e7 /lld | |
| parent | 3985c8c64680d89a3ab328347e795af0c69c48ea (diff) | |
| download | bcm5719-llvm-a00abba152026a357adb4dfdd79d05a124b330b9.tar.gz bcm5719-llvm-a00abba152026a357adb4dfdd79d05a124b330b9.zip | |
[ELF] Add -z muldefs option.
This adds -z muldefs option which is widely used over
--allow-multiple-definition.
This option is supported by the GNU linker.
llvm-svn: 205391
Diffstat (limited to 'lld')
| -rw-r--r-- | lld/lib/Driver/GnuLdDriver.cpp | 10 | ||||
| -rw-r--r-- | lld/test/elf/allowduplicates.objtxt | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp index 47312533837..9d380e83d66 100644 --- a/lld/lib/Driver/GnuLdDriver.cpp +++ b/lld/lib/Driver/GnuLdDriver.cpp @@ -440,6 +440,16 @@ bool GnuLdDriver::parse(int argc, const char *argv[], groupStack.pop(); break; + case OPT_z: { + StringRef extOpt = inputArg->getValue(); + if (extOpt == "muldefs") + ctx->setAllowDuplicates(true); + else + diagnostics << "warning: ignoring unknown argument for -z: " << extOpt + << "\n"; + break; + } + case OPT_INPUT: case OPT_l: { bool isDashlPrefix = (inputArg->getOption().getID() == OPT_l); diff --git a/lld/test/elf/allowduplicates.objtxt b/lld/test/elf/allowduplicates.objtxt index bb0d485b6bb..dbad3bd312e 100644 --- a/lld/test/elf/allowduplicates.objtxt +++ b/lld/test/elf/allowduplicates.objtxt @@ -1,8 +1,11 @@ -# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition -r %s \ -# RUN: --output-filetype=yaml | FileCheck %s +# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition %s \ +# RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s # -# RUN: not lld -flavor gnu -target x86_64 -r %s --output-filetype=yaml 2>&1 \ -# RUN: | FileCheck -check-prefix=ERROR %s +# RUN: not lld -flavor gnu -target x86_64 %s --output-filetype=yaml \ +# RUN: --noinhibit-exec 2>&1 | FileCheck -check-prefix=ERROR %s +# +# RUN: lld -flavor gnu -target x86_64 -z muldefs %s \ +# RUN: --noinhibit-exec --output-filetype=yaml | FileCheck %s --- defined-atoms: |

