diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2005-04-28 02:41:40 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2005-04-28 02:41:40 +0000 |
commit | 4a2afbc126e7a2a0eea6f0799ee769a9c9bdc37a (patch) | |
tree | 5e99c12f9deb0bad24fd2d5f3623991c960ac41a /ld | |
parent | 135cba24d568e3bd6fb5cf253f595125a5aabe50 (diff) | |
download | gdb-4a2afbc126e7a2a0eea6f0799ee769a9c9bdc37a.zip gdb-4a2afbc126e7a2a0eea6f0799ee769a9c9bdc37a.tar.gz gdb-4a2afbc126e7a2a0eea6f0799ee769a9c9bdc37a.tar.bz2 |
2005-04-27 H.J. Lu <hongjiu.lu@intel.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_provide_bound_symbols):
Use the first SEC_ALLOC section which isn't SEC_READONLY or the
last SEC_ALLOC section if such a section doesn't exist.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 9e4e259..cd6e7ce 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2005-04-27 H.J. Lu <hongjiu.lu@intel.com> + + * emultempl/elf32.em (gld${EMULATION_NAME}_provide_bound_symbols): + Use the first SEC_ALLOC section which isn't SEC_READONLY or the + last SEC_ALLOC section if such a section doesn't exist. + 2005-04-24 Mark Kettenis <kettenis@gnu.org> * configure.host: Add *-*-openbsd support. 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); |