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/elf-bfd.h | |
parent | 3fe702fddf7a4fc4eef46bcee1bcfada94e72627 (diff) | |
download | gdb-bf572ba0b9deeeba341d197a3412a3c0b44d819f.zip gdb-bf572ba0b9deeeba341d197a3412a3c0b44d819f.tar.gz gdb-bf572ba0b9deeeba341d197a3412a3c0b44d819f.tar.bz2 |
* 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/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 218780d..0f16456 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -255,11 +255,6 @@ struct elf_size_info { struct elf_backend_data { - /* Whether the backend uses REL or RELA relocations. FIXME: some - ELF backends use both. When we need to support one, this whole - approach will need to be changed. */ - int use_rela_p; - /* The architecture for this backend. */ enum bfd_architecture arch; @@ -540,6 +535,23 @@ struct elf_backend_data bfd_vma got_header_size; bfd_vma plt_header_size; + /* Whether the backend may use REL relocations. (Some backends use + both REL and RELA relocations, and this flag is set for those + backends.) */ + unsigned may_use_rel_p : 1; + + /* Whether the backend may use RELA relocations. (Some backends use + both REL and RELA relocations, and this flag is set for those + backends.) */ + unsigned may_use_rela_p : 1; + + /* Whether the default relocation type is RELA. If a backend with + this flag set wants REL relocations for a particular section, + it must note that explicitly. Similarly, if this flag is clear, + and the backend wants RELA relocations for a particular + section. */ + unsigned default_use_rela_p : 1; + unsigned want_got_plt : 1; unsigned plt_readonly : 1; unsigned want_plt_sym : 1; @@ -582,6 +594,8 @@ struct bfd_elf_section_data PTR stab_info; /* A pointer available for the processor specific ELF backend. */ PTR tdata; + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; }; #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) |