From 9b292d4c0eb8ee3d15d697255378516b7a785317 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 8 Jul 1996 23:29:26 +0000 Subject: [PATCH] * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry. --- bfd/ChangeLog | 2 ++ bfd/elf32-mips.c | 62 +++++++++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0c895f61ba2..d894074e9f6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,7 @@ Mon Jul 8 16:18:03 1996 Ian Lance Taylor + * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry. + * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, use ppc_elf_addr16_ha_reloc. (ppc_elf_addr16_ha_reloc): New static function. diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 3ae2d2e4661..040eb0ba0f9 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1238,7 +1238,6 @@ static CONST struct elf_reloc_map mips_reloc_map[] = { BFD_RELOC_16, R_MIPS_16 }, { BFD_RELOC_32, R_MIPS_32 }, { BFD_RELOC_CTOR, R_MIPS_32 }, - { BFD_RELOC_32_PCREL, R_MIPS_REL32 }, { BFD_RELOC_MIPS_JMP, R_MIPS_26 }, { BFD_RELOC_HI16_S, R_MIPS_HI16 }, { BFD_RELOC_LO16, R_MIPS_LO16 }, @@ -4416,7 +4415,8 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_byte *cr; if ((info->shared - || (h != NULL + || (elf_hash_table (info)->dynamic_sections_created + && h != NULL && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))) && (input_section->flags & SEC_ALLOC) != 0) @@ -4956,36 +4956,39 @@ mips_elf_check_relocs (abfd, info, sec, relocs) if ((info->shared || h != NULL) && (sec->flags & SEC_ALLOC) != 0) { - /* When creating a shared object, we must copy these - reloc types into the output file as R_MIPS_REL32 - relocs. We create the .rel.dyn reloc section in - dynobj and make room for this reloc. */ - if (sreloc == NULL) + if (info->shared) { - const char *name = ".rel.dyn"; - - sreloc = bfd_get_section_by_name (dynobj, name); + /* When creating a shared object, we must copy these + reloc types into the output file as R_MIPS_REL32 + relocs. We create the .rel.dyn reloc section in + dynobj and make room for this reloc. */ if (sreloc == NULL) { - sreloc = bfd_make_section (dynobj, name); - if (sreloc == NULL - || ! bfd_set_section_flags (dynobj, sreloc, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, sreloc, 4)) - return false; + const char *name = ".rel.dyn"; - /* Add a null element. */ - sreloc->_raw_size += sizeof (Elf32_External_Rel); - ++sreloc->reloc_count; + sreloc = bfd_get_section_by_name (dynobj, name); + if (sreloc == NULL) + { + sreloc = bfd_make_section (dynobj, name); + if (sreloc == NULL + || ! bfd_set_section_flags (dynobj, sreloc, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, sreloc, + 4)) + return false; + + /* Add a null element. */ + sreloc->_raw_size += sizeof (Elf32_External_Rel); + ++sreloc->reloc_count; + } } - } - if (info->shared) - sreloc->_raw_size += sizeof (Elf32_External_Rel); + sreloc->_raw_size += sizeof (Elf32_External_Rel); + } else { struct mips_elf_link_hash_entry *hmips; @@ -5383,6 +5386,7 @@ mips_elf_size_dynamic_sections (output_bfd, info) struct bfd_strtab_hash *dynstr; struct mips_got_info *g; + c = 0; if (elf_hash_table (info)->dynamic_sections_created) { if (SGI_COMPAT (output_bfd)) @@ -6128,7 +6132,11 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = #define TARGET_BIG_NAME "elf32-bigmips" #define ELF_ARCH bfd_arch_mips #define ELF_MACHINE_CODE EM_MIPS -#define ELF_MAXPAGESIZE 0x10000 + +/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses + a value of 0x1000, and we are compatible. */ +#define ELF_MAXPAGESIZE 0x1000 + #define elf_backend_collect true #define elf_backend_type_change_ok true #define elf_info_to_howto 0 -- 2.30.2