aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/elf32.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/elf32.em')
-rw-r--r--ld/emultempl/elf32.em15
1 files changed, 14 insertions, 1 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 87edf6f..9bcafef 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1457,8 +1457,21 @@ gld${EMULATION_NAME}_provide_bound_symbols (const char *sec,
}
else
{
+ /* We have to choose those values very carefully. Some targets,
+ like alpha, may have relocation overflow with 0. We use the
+ first SEC_ALLOC section which isn't SEC_READONLY or the last
+ SEC_ALLOC section. */
start_val = 0;
- end_val = 0;
+ for (s = output_bfd->sections; s != NULL; s = s->next)
+ {
+ if ((s->flags & SEC_ALLOC) != 0)
+ {
+ start_val = s->vma;
+ if ((s->flags & SEC_READONLY) == 0)
+ break;
+ }
+ }
+ end_val = start_val;
}
_bfd_elf_provide_symbol (&link_info, start, start_val);
_bfd_elf_provide_symbol (&link_info, end, end_val);