aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2005-01-28 17:24:41 +0000
committerJulian Brown <julian@codesourcery.com>2005-01-28 17:24:41 +0000
commit319850b45155323419e8862ee9e1b20d12b3a62d (patch)
tree71d81d25b3464a0cfb07087d2a86a66d307c3931 /ld/emultempl
parentc84141d67e109faa68267eba2fbfbb4840a103c2 (diff)
downloadgdb-319850b45155323419e8862ee9e1b20d12b3a62d.zip
gdb-319850b45155323419e8862ee9e1b20d12b3a62d.tar.gz
gdb-319850b45155323419e8862ee9e1b20d12b3a62d.tar.bz2
* bfd/bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
* bfd/bin-in2.h (bfd_elf32_arm_set_target_relocs): Update prototype. * bfd/elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx flag. (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx for passing flag value from ld. Set flag value in global hash table entry. (elf32_arm_final_link_relocate): Add code to implement R_ARM_V4BX relocation. * ld/emultempl/armelf.em (fix_v4bx): New variable. (arm_elf_create_output_section_statements): Communicate fix_v4bx flag value to bfd. (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_FIX_V4BX. (PARSE_AND_LIST_LONGOPTS): Add option --fix-v4bx. (PARSE_AND_LIST_OPTIONS): Add option --fix-v4bx. (PARSE_AND_LIST_ARGS_CASES): Add option OPTION_FIX_V4BX. * ld/NEWS: Mention --fix-v4bx. * ld/ld.texinfo: Document --fix-v4bx.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/armelf.em11
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index b292cd1..01955f4 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -30,6 +30,7 @@ static bfd *bfd_for_interwork;
static int byteswap_code = 0;
static int target1_is_rel = 0${TARGET1_IS_REL};
static char *target2_type = "${TARGET2_TYPE}";
+static int fix_v4bx = 0;
static void
gld${EMULATION_NAME}_before_parse (void)
@@ -189,7 +190,8 @@ arm_elf_finish (void)
static void
arm_elf_create_output_section_statements (void)
{
- bfd_elf32_arm_set_target_relocs (&link_info, target1_is_rel, target2_type);
+ bfd_elf32_arm_set_target_relocs (&link_info, target1_is_rel, target2_type,
+ fix_v4bx);
}
EOF
@@ -203,6 +205,7 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_TARGET1_REL 303
#define OPTION_TARGET1_ABS 304
#define OPTION_TARGET2 305
+#define OPTION_FIX_V4BX 306
'
PARSE_AND_LIST_SHORTOPTS=p
@@ -214,6 +217,7 @@ PARSE_AND_LIST_LONGOPTS='
{ "target1-rel", no_argument, NULL, OPTION_TARGET1_REL},
{ "target1-abs", no_argument, NULL, OPTION_TARGET1_ABS},
{ "target2", required_argument, NULL, OPTION_TARGET2},
+ { "fix-v4bx", no_argument, NULL, OPTION_FIX_V4BX},
'
PARSE_AND_LIST_OPTIONS='
@@ -222,6 +226,7 @@ PARSE_AND_LIST_OPTIONS='
fprintf (file, _(" --target1=rel Interpret R_ARM_TARGET1 as R_ARM_REL32\n"));
fprintf (file, _(" --target1=abs Interpret R_ARM_TARGET1 as R_ARM_ABS32\n"));
fprintf (file, _(" --target2=<type> Specify definition of R_ARM_TARGET2\n"));
+ fprintf (file, _(" --fix-v4bx Rewrite BX rn as MOV pc, rn for ARMv4\n"));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -248,6 +253,10 @@ PARSE_AND_LIST_ARGS_CASES='
case OPTION_TARGET2:
target2_type = optarg;
break;
+
+ case OPTION_FIX_V4BX:
+ fix_v4bx = 1;
+ break;
'
# We have our own after_open and before_allocation functions, but they call