Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Commit 3940d2c

Browse files
committed
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.
1 parent 797eee4 commit 3940d2c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ld/ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2015-11-16 Nick Clifton <[email protected]>
2+
3+
PR ld/19106
4+
* emultempl/armelf.em (_set_symbols): New function. Enables
5+
relaxation for non-relocatable links.
6+
(LDEMUL_SET_SYMBOLS): Define.
7+
18
2015-11-13 Tristan Gingold <[email protected]>
29

310
* configure: Regenerate.

ld/emultempl/armelf.em

+14
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ gld${EMULATION_NAME}_before_parse (void)
5454
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
5555
}
5656

57+
static void
58+
gld${EMULATION_NAME}_set_symbols (void)
59+
{
60+
/* PR 19106: The section resizing code in gldarmelf_after_allocation
61+
is effectively the same as relaxation, so prevent early memory
62+
region checks which produce bogus error messages.
63+
Note - this test has nothing to do with symbols. It is just here
64+
because this is the first emulation routine that is called after
65+
the command line has been parsed. */
66+
if (!bfd_link_relocatable (&link_info))
67+
TARGET_ENABLE_RELAXATION;
68+
}
69+
5770
static void
5871
arm_elf_before_allocation (void)
5972
{
@@ -728,6 +741,7 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=arm_elf_create_output_section_statements
728741

729742
# Replace the elf before_parse function with our own.
730743
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
744+
LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols
731745

732746
# Call the extra arm-elf function
733747
LDEMUL_FINISH=gld${EMULATION_NAME}_finish

0 commit comments

Comments
 (0)