diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2008-08-07 20:04:32 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@nildram.co.uk> | 2008-08-07 20:04:32 +0000 |
commit | d21a9929e61f37967b18ee71068a015e688ea5cf (patch) | |
tree | 137f4778082563cde8588aa44937882ed1c6f9d0 /bfd | |
parent | 76b7807cb41ccc38bb3bbd19e79ab1fca1408676 (diff) | |
download | gdb-d21a9929e61f37967b18ee71068a015e688ea5cf.tar.gz |
bfd/
* elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field.
* elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro.
(elfNN_bed): Use it.
* elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p
instead of default_use_rela_p to choose between ".rel.plt" and
".rela.plt".
* elflink.c (_bfd_elf_create_dynamic_sections): Use
rela_plts_and_copies_p instead of default_use_rela_p to choose
between ".rel.plt" and ".rela.plt", and between ".rel.bss" and
".rela.bss".
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 13 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 3 | ||||
-rw-r--r-- | bfd/elf.c | 2 | ||||
-rw-r--r-- | bfd/elflink.c | 4 | ||||
-rw-r--r-- | bfd/elfxx-target.h | 4 |
5 files changed, 23 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 98ec7e7a70d..ea94b0255a7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,18 @@ 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com> + * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field. + * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro. + (elfNN_bed): Use it. + * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p + instead of default_use_rela_p to choose between ".rel.plt" and + ".rela.plt". + * elflink.c (_bfd_elf_create_dynamic_sections): Use + rela_plts_and_copies_p instead of default_use_rela_p to choose + between ".rel.plt" and ".rela.plt", and between ".rel.bss" and + ".rela.bss". + +2008-08-07 Richard Sandiford <rdsandiford@googlemail.com> + * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id. * elf32-mips.c (bfd_elf32_mkobject): Define. * elf64-mips.c (bfd_elf64_mkobject): Likewise. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index d1772557b8f..2b739f94212 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1189,6 +1189,9 @@ struct elf_backend_data section. */ unsigned default_use_rela_p : 1; + /* True if PLT and copy relocations should be RELA by default. */ + unsigned rela_plts_and_copies_p : 1; + /* Set if RELA relocations for a relocatable link can be handled by generic code. Backends that set this flag need do nothing in the backend relocate_section routine for relocatable linking. */ diff --git a/bfd/elf.c b/bfd/elf.c index 6b67e16fd43..beb6d1b7d03 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -8809,7 +8809,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, relplt_name = bed->relplt_name; if (relplt_name == NULL) - relplt_name = bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"; + relplt_name = bed->rela_plts_and_copies_p ? ".rela.plt" : ".rel.plt"; relplt = bfd_get_section_by_name (abfd, relplt_name); if (relplt == NULL) return 0; diff --git a/bfd/elflink.c b/bfd/elflink.c index 488f98afdb7..de7f3ba40f5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -309,7 +309,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) } s = bfd_make_section_with_flags (abfd, - (bed->default_use_rela_p + (bed->rela_plts_and_copies_p ? ".rela.plt" : ".rel.plt"), flags | SEC_READONLY); if (s == NULL @@ -347,7 +347,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) if (! info->shared) { s = bfd_make_section_with_flags (abfd, - (bed->default_use_rela_p + (bed->rela_plts_and_copies_p ? ".rela.bss" : ".rel.bss"), flags | SEC_READONLY); if (s == NULL diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 148f5cb2bce..d897c32d1fb 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -555,6 +555,9 @@ #ifndef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p !USE_REL #endif +#ifndef elf_backend_rela_plts_and_copies_p +#define elf_backend_rela_plts_and_copies_p elf_backend_default_use_rela_p +#endif #ifndef elf_backend_rela_normal #define elf_backend_rela_normal 0 @@ -718,6 +721,7 @@ static struct elf_backend_data elfNN_bed = elf_backend_may_use_rel_p, elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, + elf_backend_rela_plts_and_copies_p, elf_backend_rela_normal, elf_backend_sign_extend_vma, elf_backend_want_got_plt, |