aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-11-16 14:21:28 +0000
committerNick Clifton <nickc@redhat.com>2015-11-16 14:21:28 +0000
commit3940d2c36abbf7c4701e312bd76f6bb119898c8a (patch)
tree1372e58697f86ce2c1ea27fafa2895f9533178ea
parent797eee4264d1b504aabcbcabb6de2f1108441261 (diff)
downloadgdb-3940d2c36abbf7c4701e312bd76f6bb119898c8a.zip
gdb-3940d2c36abbf7c4701e312bd76f6bb119898c8a.tar.gz
gdb-3940d2c36abbf7c4701e312bd76f6bb119898c8a.tar.bz2
Fixes an invalid warning about memory region overflow on the ARM.
PR ld/19106 * emultempl/armelf.em (_set_symbols): New function. Enables relaxation for non-relocatable links. (LDEMUL_SET_SYMBOLS): Define.
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/armelf.em14
2 files changed, 21 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d5e450e..d4324ec 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-16 Nick Clifton <nickc@redhat.com>
+
+ PR ld/19106
+ * emultempl/armelf.em (_set_symbols): New function. Enables
+ relaxation for non-relocatable links.
+ (LDEMUL_SET_SYMBOLS): Define.
+
2015-11-13 Tristan Gingold <gingold@adacore.com>
* configure: Regenerate.
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index b03aed4..2931a49 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -55,6 +55,19 @@ gld${EMULATION_NAME}_before_parse (void)
}
static void
+gld${EMULATION_NAME}_set_symbols (void)
+{
+ /* PR 19106: The section resizing code in gldarmelf_after_allocation
+ is effectively the same as relaxation, so prevent early memory
+ region checks which produce bogus error messages.
+ Note - this test has nothing to do with symbols. It is just here
+ because this is the first emulation routine that is called after
+ the command line has been parsed. */
+ if (!bfd_link_relocatable (&link_info))
+ TARGET_ENABLE_RELAXATION;
+}
+
+static void
arm_elf_before_allocation (void)
{
bfd_elf32_arm_set_byteswap_code (&link_info, byteswap_code);
@@ -728,6 +741,7 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=arm_elf_create_output_section_statements
# Replace the elf before_parse function with our own.
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
+LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols
# Call the extra arm-elf function
LDEMUL_FINISH=gld${EMULATION_NAME}_finish