From: "Mark P. Mitchell" <mark@codesourcery.com>
To: binutils@sourceware.cygnus.com
Subject: elf32-mips.c patch from Ralf
Date: Mon, 09 Aug 1999 23:42:00 -0000 [thread overview]
Message-ID: <199908100642.AAA771405@n02.acl.lanl.gov> (raw)
Ralf suggested an alternate fix to the one I checked in for the case
where there are no global GOT entries. He pointed out that my fix
wsa not ABI-compliant. Here's the patch.
-- Mark
Tue Aug 10 00:34:29 1999 Mark P. Mitchell <mark@codesourcery.com>
Ralf Baechle <ralf@uni-koblenz.de>
* 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.
Index: elf32-mips.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v
retrieving revision 1.47
diff -c -p -r1.47 elf32-mips.c
*** elf32-mips.c 1999/08/10 06:27:47 1.47
--- elf32-mips.c 1999/08/10 06:41:41
*************** _bfd_mips_elf_check_relocs (abfd, info,
*** 7557,7563 ****
/* 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
dynamic relocations against it. */
if (h != NULL
&& !mips_elf_record_global_got_symbol (h, info, g))
--- 7557,7563 ----
/* 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_MIPS_GOTSYM if there are
dynamic relocations against it. */
if (h != NULL
&& !mips_elf_record_global_got_symbol (h, info, g))
*************** _bfd_mips_elf_size_dynamic_sections (out
*** 8163,8170 ****
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))
return false;
if (IRIX_COMPAT (dynobj) == ict_irix5
--- 8163,8169 ----
if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
return false;
! if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
return false;
if (IRIX_COMPAT (dynobj) == ict_irix5
*************** _bfd_mips_elf_finish_dynamic_sections (o
*** 8559,8564 ****
--- 8558,8580 ----
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);
*************** _bfd_mips_elf_finish_dynamic_sections (o
*** 8569,8585 ****
dyn.d_un.d_val = s->_cooked_size / elemsize;
else
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:
--- 8585,8590 ----
reply other threads:[~1999-08-09 23:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199908100642.AAA771405@n02.acl.lanl.gov \
--to=mark@codesourcery.com \
--cc=binutils@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).