This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Forcing symbols into the GOT on mips
- From: Jeff Baker <jbaker at qnx dot com>
- To: "'binutils at sourceware dot org'" <binutils at sourceware dot org>
- Date: Mon, 13 Jun 2005 16:10:11 -0400
- Subject: Forcing symbols into the GOT on mips
Below is a fragment of code from our MIPS patch. The code you see removed
was part of our 2.12.1 patch that no longer functions correctly in 2.16.
The modifications in mips_elf_sort_hash_table_f technically work, but I
doubt it's the correct/best way to accomplish this.
Question #2 in the following posting gives a little more information about
the problem I'm trying to solve.
http://sourceware.org/ml/binutils/2004-07/msg00265.html
I'm in another window of opportunity to work on this patch and I think this
is the last hurdle. I would appreciate any help I can get to figure out
where and how to do this correctly.
P.S. Ignore the revision numbers. It's from source in our internal CVS.
Index: elfxx-mips.c
===================================================================
RCS file: /product/tools/binutils/bfd/elfxx-mips.c,v
retrieving revision 1.3
diff -w -u -p -r1.3 elfxx-mips.c
--- elfxx-mips.c 30 May 2005 20:09:41 -0000 1.3
+++ elfxx-mips.c 13 Jun 2005 19:54:50 -0000
@@ -2622,12 +2622,14 @@ mips_elf_sort_hash_table_f (struct mips_
hsd->low = (struct elf_link_hash_entry *) h;
h->root.dynindx = hsd->max_unref_got_dynindx++;
}
- else if (h->root.got.offset != 1)
+ else if ((h->root.got.offset != 1) && !(h->root.def_dynamic
+ && h->root.ref_regular))
h->root.dynindx = hsd->max_non_got_dynindx++;
else
{
BFD_ASSERT (h->tls_type == GOT_NORMAL);
+ h->root.got.offset = 1;
h->root.dynindx = --hsd->min_got_dynindx;
hsd->low = (struct elf_link_hash_entry *) h;
}
@@ -6493,13 +6495,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str
dynobj = elf_hash_table (info)->dynobj;
- if (QNX_COMPAT(dynobj)) {
- if (h->got.offset == MINUS_ONE)
- {
- h->got.offset = 1;
- }
- }
-
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
&& (h->needs_plt