diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-06-02 13:01:04 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 1999-06-02 13:01:04 +0000 |
commit | bf572ba0b9deeeba341d197a3412a3c0b44d819f (patch) | |
tree | ca0102a08126c8ccfea30b798468cc30711e95a7 /bfd/elfxx-target.h | |
parent | 3fe702fddf7a4fc4eef46bcee1bcfada94e72627 (diff) | |
download | ppe42-binutils-bf572ba0b9deeeba341d197a3412a3c0b44d819f.tar.gz ppe42-binutils-bf572ba0b9deeeba341d197a3412a3c0b44d819f.zip |
* elf-bfd.h (elf_backend_data): Remove use_rela_p. Add
may_use_rel_p, may_use_rela_p, default_use_rela_p.
(bfd_elf_section_data): Add use_rela_p.
* elf.c (bfd_section_from_shdr): Set use_rela_p appropriately.
(_bfd_elf_new_section_hook): Likewise.
(elf_fake_sections): Use may_use_rela_p, etc., instead of
use_rela_p.
(_bfd_elf_copy_private_section_data): Copy use_rela_p.
* elfcode.h (write_relocs): Determine whether or not use rela
relocs based on the relocation section header.
* elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p
instead of use_rela_p.
* elfxx-target.h (elf_backend_may_use_relp): New macro.
(elf_backend_may_use_rela_p): Likewise.
(elf_backend_default_use_rela_p): Likewise.
(elfNN_bed): Use them.
Diffstat (limited to 'bfd/elfxx-target.h')
-rw-r--r-- | bfd/elfxx-target.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index dc116ef3a9..976e68baff 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -294,6 +294,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_backend_post_process_headers NULL #endif +/* Previously, backends could only use SHT_REL or SHT_RELA relocation + sections, but not both. They defined USE_REL to indicate SHT_REL + sections, and left it undefined to indicated SHT_RELA sections. + For backwards compatibility, we still support this usage. */ +#ifndef USE_REL +#define USE_REL 0 +#else +#undef USE_REL +#define USE_REL 1 +#endif + +/* Use these in new code. */ +#ifndef elf_backend_may_use_rel_p +#define elf_backend_may_use_rel_p USE_REL +#endif +#ifndef elf_backend_may_use_rela_p +#define elf_backend_may_use_rela_p !USE_REL +#endif +#ifndef elf_backend_default_use_rela_p +#define elf_backend_default_use_rela_p !USE_REL +#endif + #ifndef ELF_MACHINE_ALT1 #define ELF_MACHINE_ALT1 0 #endif @@ -310,11 +332,6 @@ extern const struct elf_size_info _bfd_elfNN_size_info; static CONST struct elf_backend_data elfNN_bed = { -#ifdef USE_REL - 0, /* use_rela_p */ -#else - 1, /* use_rela_p */ -#endif ELF_ARCH, /* arch */ ELF_MACHINE_CODE, /* elf_machine_code */ ELF_MAXPAGESIZE, /* maxpagesize */ @@ -355,6 +372,9 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_got_symbol_offset, elf_backend_got_header_size, elf_backend_plt_header_size, + elf_backend_may_use_rel_p, + elf_backend_may_use_rela_p, + elf_backend_default_use_rela_p, elf_backend_want_got_plt, elf_backend_plt_readonly, elf_backend_want_plt_sym, |