summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeny Kholodov <lkholodov@accesssoftek.com>2015-04-22 11:58:09 +0000
committerLeny Kholodov <lkholodov@accesssoftek.com>2015-04-22 11:58:09 +0000
commit592cee666e17edd4402f355f36af51f41915efbe (patch)
treedbbb843e16772176d8d1ad9a73c5926da23c39dd
parent9e4292c0ecb1235c47b8394203a70f8a9ca18458 (diff)
downloadbcm5719-llvm-592cee666e17edd4402f355f36af51f41915efbe.tar.gz
bcm5719-llvm-592cee666e17edd4402f355f36af51f41915efbe.zip
[ARM] Update R_ARM_TARGET1 command line option names (remove prefix 'arm-')
Command line options --arm-target1-rel and --arm-target1-abs have been renamed to be compatible with GNU linkers. Two tests have been updated: test/elf/options/target-specific-args.test test/elf/ARM/rel-arm-target1.test Differential Revision: http://reviews.llvm.org/D9037 llvm-svn: 235499
-rw-r--r--lld/lib/Driver/GnuLdDriver.cpp17
-rw-r--r--lld/lib/Driver/GnuLdOptions.td14
-rw-r--r--lld/test/elf/ARM/rel-arm-target1.test4
-rw-r--r--lld/test/elf/options/target-specific-args.test4
4 files changed, 22 insertions, 17 deletions
diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp
index c7cfe5de2e0..a5f5e69fb50 100644
--- a/lld/lib/Driver/GnuLdDriver.cpp
+++ b/lld/lib/Driver/GnuLdDriver.cpp
@@ -545,22 +545,21 @@ bool GnuLdDriver::parse(int argc, const char *argv[],
ctx->setOutputFileType(arg->getValue());
// Process ELF/ARM specific options
- bool hasArmTarget1Rel = parsedArgs->hasArg(OPT_arm_target1_rel);
- bool hasArmTarget1Abs = parsedArgs->hasArg(OPT_arm_target1_abs);
+ bool hasArmTarget1Rel = parsedArgs->hasArg(OPT_target1_rel);
+ bool hasArmTarget1Abs = parsedArgs->hasArg(OPT_target1_abs);
if (triple.getArch() == llvm::Triple::arm) {
if (hasArmTarget1Rel && hasArmTarget1Abs) {
- diag << "error: options --arm-target1-rel and --arm-target1-abs"
+ diag << "error: options --target1-rel and --target1-abs"
" can't be used together.\n";
return false;
} else if (hasArmTarget1Rel || hasArmTarget1Abs) {
ctx->setArmTarget1Rel(hasArmTarget1Rel && !hasArmTarget1Abs);
}
- } else if (hasArmTarget1Rel) {
- diag << "warning: ignoring unsupported ARM/ELF specific argument: "
- << "--arm-target1-rel\n";
- } else if (hasArmTarget1Abs) {
- diag << "warning: ignoring unsupported ARM/ELF specific argument: "
- << "--arm-target1-abs\n";
+ } else {
+ for (const auto *arg : parsedArgs->filtered(OPT_grp_arm_targetopts)) {
+ diag << "warning: ignoring unsupported ARM/ELF specific argument: "
+ << arg->getSpelling() << "\n";
+ }
}
// Process MIPS specific options.
diff --git a/lld/lib/Driver/GnuLdOptions.td b/lld/lib/Driver/GnuLdOptions.td
index 8f4b042687a..b3c3d90c168 100644
--- a/lld/lib/Driver/GnuLdOptions.td
+++ b/lld/lib/Driver/GnuLdOptions.td
@@ -333,10 +333,16 @@ def alias_output_filetype: Joined<["--"], "output-filetype=">,
//===----------------------------------------------------------------------===//
def grp_targetopts : OptionGroup<"opts">,
HelpText<"ARCH SPECIFIC OPTIONS">;
-def arm_target1_rel : Flag<["--"], "arm-target1-rel">,
- Group<grp_targetopts>, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
-def arm_target1_abs : Flag<["--"], "arm-target1-abs">,
- Group<grp_targetopts>, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32">;
+
+//===----------------------------------------------------------------------===//
+/// ARM Target Specific Options
+//===----------------------------------------------------------------------===//
+def grp_arm_targetopts : OptionGroup<"ARM SPECIFIC OPTIONS">,
+ Group<grp_targetopts>;
+def target1_rel : Flag<["--"], "target1-rel">,
+ Group<grp_arm_targetopts>, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
+def target1_abs : Flag<["--"], "target1-abs">,
+ Group<grp_arm_targetopts>, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32">;
//===----------------------------------------------------------------------===//
/// MIPS Target Specific Options
diff --git a/lld/test/elf/ARM/rel-arm-target1.test b/lld/test/elf/ARM/rel-arm-target1.test
index f001c68df09..a2de45d1388 100644
--- a/lld/test/elf/ARM/rel-arm-target1.test
+++ b/lld/test/elf/ARM/rel-arm-target1.test
@@ -3,7 +3,7 @@
# 1. R_ARM_TARGET1 is equal to R_ARM_ABS32
# RUN: yaml2obj -format=elf -docnum 1 %s > %t-abs32.o
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \
-# RUN: --noinhibit-exec --arm-target1-abs %t-abs32.o -o %t-abs32
+# RUN: --noinhibit-exec --target1-abs %t-abs32.o -o %t-abs32
# RUN: llvm-objdump -s -t %t-abs32 | FileCheck -check-prefix=CHECK-ABS32 %s
#
# CHECK-ABS32: Contents of section .data:
@@ -16,7 +16,7 @@
# Check handling of R_ARM_REL32 relocation.
# RUN: yaml2obj -format=elf %s -docnum 2 > %t-rel32.o
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \
-# RUN: --noinhibit-exec --arm-target1-rel %t-rel32.o -o %t-rel32
+# RUN: --noinhibit-exec --target1-rel %t-rel32.o -o %t-rel32
# RUN: llvm-objdump -s -t %t-rel32 | FileCheck -check-prefix=CHECK-REL32 %s
#
# CHECK-REL32: Contents of section .text:
diff --git a/lld/test/elf/options/target-specific-args.test b/lld/test/elf/options/target-specific-args.test
index a91889fccfe..cdcd9b8a5de 100644
--- a/lld/test/elf/options/target-specific-args.test
+++ b/lld/test/elf/options/target-specific-args.test
@@ -1,5 +1,5 @@
# Test of target specific options
-# RUN: lld -flavor gnu -target x86_64 --arm-target1-rel \
+# RUN: lld -flavor gnu -target x86_64 --target1-rel \
# RUN: %p/../Inputs/foo.o.x86-64 --noinhibit-exec -o %t 2>&1 | FileCheck %s
-# CHECK: warning: ignoring unsupported ARM/ELF specific argument: --arm-target1-rel
+# CHECK: warning: ignoring unsupported ARM/ELF specific argument: --target1-rel
OpenPOWER on IntegriCloud