Fixes an invalid warning about memory region overflow on the ARM.
authorNick Clifton <nickc@redhat.com>
Mon, 16 Nov 2015 14:21:28 +0000 (14:21 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 16 Nov 2015 14:21:28 +0000 (14:21 +0000)
PR ld/19106
* emultempl/armelf.em (_set_symbols): New function.  Enables
relaxation for non-relocatable links.
(LDEMUL_SET_SYMBOLS): Define.

ld/ChangeLog
ld/emultempl/armelf.em

index d5e450e931fb820ca1d5b1bce445f7a8ac0d3b51..d4324ec6d50532af07cc1c857dfdb943aa6889de 100644 (file)
@@ -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.
index b03aed40bf9fbd2c7b590464cbbf214b226bc02f..2931a49f3fb0fee2a035d0788ead7726eab83d10 100644 (file)
@@ -54,6 +54,19 @@ gld${EMULATION_NAME}_before_parse (void)
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
 }
 
+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)
 {
@@ -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