diff options
author | Alan Modra <amodra@gmail.com> | 2013-03-20 03:44:56 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-03-20 03:44:56 +0000 |
commit | 8877b5e517baa355c68568e7c5e3ed01d277254a (patch) | |
tree | ce1ed473d31da5ef87d6d40da987380d52b8e389 /bfd | |
parent | 8249a5a9e2a886aeb3b7142a5dc5a8b4f1b4665b (diff) | |
download | gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.zip gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.tar.gz gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.tar.bz2 |
bfd/
* elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
sh_type according to is_rela.
ld/testsuite/
* ld-elf/rel.c, ld-elf/relmain.c, ld-elf/relmain.out: New test.
* ld-elf/shared.exp: Build and run it.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b710f3c..d30bd2e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-03-20 Alan Modra <amodra@gmail.com> + + * elflink.c (_bfd_elf_make_dynamic_reloc_section): Override + sh_type according to is_rela. + 2013-03-18 Alan Modra <amodra@gmail.com> PR ld/12549 diff --git a/bfd/elflink.c b/bfd/elflink.c index 8055d26..6ccf625 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -13025,6 +13025,11 @@ _bfd_elf_make_dynamic_reloc_section (asection * sec, reloc_sec = bfd_make_section_anyway_with_flags (dynobj, name, flags); if (reloc_sec != NULL) { + /* _bfd_elf_get_sec_type_attr chooses a section type by + name. Override as it may be wrong, eg. for a user + section named "auto" we'll get ".relauto" which is + seen to be a .rela section. */ + elf_section_type (reloc_sec) = is_rela ? SHT_RELA : SHT_REL; if (! bfd_set_section_alignment (dynobj, reloc_sec, alignment)) reloc_sec = NULL; } |