aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-10 06:43:11 +0000
committerMark Mitchell <mark@codesourcery.com>1999-08-10 06:43:11 +0000
commit5499724a85d9cb03d56bb3aa7ef6519c00cfece8 (patch)
tree2570cc49513475c22cc91f0013c09ad2f946d2b9 /bfd/elf32-mips.c
parent7b1f123191d2d70a86e790e57f26eea2aa7082e7 (diff)
downloadgdb-5499724a85d9cb03d56bb3aa7ef6519c00cfece8.zip
gdb-5499724a85d9cb03d56bb3aa7ef6519c00cfece8.tar.gz
gdb-5499724a85d9cb03d56bb3aa7ef6519c00cfece8.tar.bz2
* elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always
output DT_MIPS_GOTSYM. (_bfd_mips_elf_finish_dynamic_sections): Use the same value as DT_MIPS_SYMTABNO if there are no global GOT symbols.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 9eafe72..f152691 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -7557,7 +7557,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
/* Even though we don't directly need a GOT entry for
this symbol, a symbol must have a dynamic symbol
- table index greater that DT_GOTSYM if there are
+ table index greater that DT_MIPS_GOTSYM if there are
dynamic relocations against it. */
if (h != NULL
&& !mips_elf_record_global_got_symbol (h, info, g))
@@ -8163,8 +8163,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
return false;
- if (g != NULL && g->global_gotsym != NULL
- && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
return false;
if (IRIX_COMPAT (dynobj) == ict_irix5
@@ -8559,6 +8558,23 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
dyn.d_un.d_val = g->local_gotno;
break;
+ case DT_MIPS_UNREFEXTNO:
+ /* The index into the dynamic symbol table which is the
+ entry of the first external symbol that is not
+ referenced within the same object. */
+ dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
+ break;
+
+ case DT_MIPS_GOTSYM:
+ if (g->global_gotsym)
+ {
+ dyn.d_un.d_val = g->global_gotsym->dynindx;
+ break;
+ }
+ /* In case if we don't have global got symbols we default
+ to setting DT_MIPS_GOTSYM to the same value as
+ DT_MIPS_SYMTABNO, so we just fall through. */
+
case DT_MIPS_SYMTABNO:
name = ".dynsym";
elemsize = MIPS_ELF_SYM_SIZE (output_bfd);
@@ -8571,17 +8587,6 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
dyn.d_un.d_val = s->_raw_size / elemsize;
break;
- case DT_MIPS_UNREFEXTNO:
- /* The index into the dynamic symbol table which is the
- entry of the first external symbol that is not
- referenced within the same object. */
- dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
- break;
-
- case DT_MIPS_GOTSYM:
- dyn.d_un.d_val = g->global_gotsym->dynindx;
- break;
-
case DT_MIPS_HIPAGENO:
dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO;
break;