aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-10-11 01:13:10 +0000
committerAlan Modra <amodra@gmail.com>2004-10-11 01:13:10 +0000
commit1da212d6fb911a6b167ffe3d76fcb195525adfdd (patch)
tree17b4b81b038026465d172f9c0b850f07f0b7b35c /bfd
parent0fce082197131e394a9148c0bc2308c02d567594 (diff)
downloadgdb-1da212d6fb911a6b167ffe3d76fcb195525adfdd.zip
gdb-1da212d6fb911a6b167ffe3d76fcb195525adfdd.tar.gz
gdb-1da212d6fb911a6b167ffe3d76fcb195525adfdd.tar.bz2
PR 437
* elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections. (_bfd_elf_link_omit_section_dynsym): Formatting.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dcf9aeb..cc79ca5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-11 Alan Modra <amodra@bigpond.net.au>
+
+ PR 437
+ * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
+ (_bfd_elf_link_omit_section_dynsym): Formatting.
+
2004-10-10 Alan Modra <amodra@bigpond.net.au>
* libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 69fdcc0..08c0aee 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -629,8 +629,7 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
bfd *dynobj = elf_hash_table (info)->dynobj;
if (dynobj != NULL
- && (ip = bfd_get_section_by_name (dynobj, p->name))
- != NULL
+ && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL
&& (ip->flags & SEC_LINKER_CREATED)
&& ip->output_section == p)
return TRUE;
@@ -5712,6 +5711,14 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
bfd_byte *erel, *erelend;
asection *o = lo->u.indirect.section;
+ if (o->contents == NULL && o->size != 0)
+ {
+ /* This is a reloc section that is being handled as a normal
+ section. See bfd_section_from_shdr. We can't combine
+ relocs in this case. */
+ free (sort);
+ return 0;
+ }
erel = o->contents;
erelend = o->contents + o->size;
p = sort + o->output_offset / ext_size * sort_elt;