aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-01-24 19:27:35 +0000
committerIan Lance Taylor <ian@airs.com>1995-01-24 19:27:35 +0000
commit16fe8950adaf5f2cb17ea260bbf6ea9e52919045 (patch)
treeac97708d228f3d43de8b9c7ac90512a9f9c56b00 /bfd/elf32-mips.c
parent5f3548d6c755c7ddda69071cc80aa9f1f905ea24 (diff)
downloadgdb-16fe8950adaf5f2cb17ea260bbf6ea9e52919045.zip
gdb-16fe8950adaf5f2cb17ea260bbf6ea9e52919045.tar.gz
gdb-16fe8950adaf5f2cb17ea260bbf6ea9e52919045.tar.bz2
* elf32-mips.c (mips_elf_output_extsym): Set the value of the
ECOFF symbol from the hash table entry.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index af076e0..d8c24de 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -65,7 +65,7 @@ static bfd_reloc_status_type mips_elf_gprel16_reloc PARAMS ((bfd *abfd,
asection *section,
bfd *output_bfd,
char **error));
-static const struct reloc_howto_struct *bfd_elf32_bfd_reloc_type_lookup
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void mips_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
@@ -848,7 +848,7 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
/* Given a BFD reloc type, return a howto structure. */
-static const struct reloc_howto_struct *
+static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (abfd, code)
bfd *abfd;
bfd_reloc_code_real_type code;
@@ -1719,6 +1719,22 @@ mips_elf_output_extsym (h, data)
h->esym.asym.index = indexNil;
}
+ if (h->root.root.type == bfd_link_hash_common)
+ h->esym.asym.value = h->root.root.u.c.size;
+ else if (h->root.root.type == bfd_link_hash_defined)
+ {
+ asection *sec;
+
+ if (h->esym.asym.sc == scCommon)
+ h->esym.asym.sc = scBss;
+ else if (h->esym.asym.sc == scSCommon)
+ h->esym.asym.sc = scSBss;
+
+ sec = h->root.root.u.def.section;
+ h->esym.asym.value = (h->root.root.u.def.value
+ + sec->output_offset
+ + sec->output_section->vma);
+ }
if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap,
h->root.root.root.string,