aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-02-13 22:08:52 +0000
committerIan Lance Taylor <ian@airs.com>1996-02-13 22:08:52 +0000
commite9f03cd4509f74e4ffbfb11878149d4b31401923 (patch)
tree834a17e17034d88354ebba1061757baf684b19f0 /bfd/elf32-mips.c
parent9cb8a981e9c0ebe02acfecb366032cc6a2dad7a8 (diff)
downloadgdb-e9f03cd4509f74e4ffbfb11878149d4b31401923.zip
gdb-e9f03cd4509f74e4ffbfb11878149d4b31401923.tar.gz
gdb-e9f03cd4509f74e4ffbfb11878149d4b31401923.tar.bz2
* reloc.c (BFD_RELOC_MIPS_GOT_HI16): Define.
(BFD_RELOC_MIPS_GOT_LO16): Define. * bfd-in2.h, libbfd.h: Rebuild. * elf32-mips.c (mips_reloc_map): Map new relocs.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index b6c544a..e9bdba3 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1250,7 +1250,9 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
{ BFD_RELOC_16_PCREL, R_MIPS_PC16 },
{ BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
- { BFD_RELOC_MIPS_GPREL32, R_MIPS_GPREL32 }
+ { BFD_RELOC_MIPS_GPREL32, R_MIPS_GPREL32 },
+ { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
+ { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 }
};
/* Given a BFD reloc type, return a howto structure. */
@@ -3956,6 +3958,9 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
local = false;
indx = r_symndx - extsymoff;
h = elf_sym_hashes (input_bfd)[indx];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
if (strcmp (h->root.root.string, "_gp_disp") == 0)
{
if (elf_gp (output_bfd) == 0)
@@ -4350,6 +4355,7 @@ mips_elf_create_dynamic_sections (abfd, info)
get_elf_backend_data (abfd)->collect,
(struct bfd_link_hash_entry **) &h)))
return false;
+ h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_SECTION;
@@ -4388,6 +4394,7 @@ mips_elf_create_dynamic_sections (abfd, info)
get_elf_backend_data (abfd)->collect,
(struct bfd_link_hash_entry **) &h)))
return false;
+ h->elf_link_hash_flags ^=~ ELF_LINK_NON_ELF;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_SECTION;
@@ -4458,6 +4465,7 @@ mips_elf_create_got_section (abfd, info)
get_elf_backend_data (abfd)->collect,
(struct bfd_link_hash_entry **) &h)))
return false;
+ h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_OBJECT;
@@ -5832,6 +5840,5 @@ static const struct ecoff_debug_swap mips_elf_ecoff_debug_swap =
mips_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
mips_elf_finish_dynamic_sections
-#define elf_backend_want_hdr_in_seg 1
#include "elf32-target.h"