summaryrefslogtreecommitdiff
path: root/bfd/elfxx-target.h
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-06-02 13:01:04 +0000
committerMark Mitchell <mark@codesourcery.com>1999-06-02 13:01:04 +0000
commit7c7f2766f1d5058baa8ac275b70ebb3d53bb5dee (patch)
tree6d0cf1b61be4f6eb4d54323d3ce46578f53597bf /bfd/elfxx-target.h
parentd39216523f86028980afd34d391be1a971909525 (diff)
downloadgdb-7c7f2766f1d5058baa8ac275b70ebb3d53bb5dee.tar.gz
* 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.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index dc116ef3a9a..976e68baff0 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,