This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS multi-got link support


On Jan 14, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:

> Yeah, testcases, I hear someone screaming :-)

Ok, having bfd ids, I've tweaked the multi-got code so as to no longer
use htab_hash_pointer.  For bfds, we use their ids, for symbols' hash
entries, we use the bfd-computed hash of the symbol name.  I've
adjusted the patch to reflect the introduction of
mips_elf_section_data and added a linker testcase.  I thought of
generating the testcase sources on the fly, but since the output
couldn't possibly be generated (unless we duplicated the logic of the
hashtable construction and walking in tcl, something I wasn't quite
looking forward to doing :-), I thought the inputs could go in the
testsuite too.

The testcase is a bit simplistic, but it does test a lot.  The offsets
of the explicitly-relocated GOT entries, compared with the PLTGOT
entry in the dynamic section, indicate they're being applied to the
second GOT, and MIPS_GOTSYM and MIPS_SYMTABNO indicate that there are
GOT entries for all of the sym_1_* symbols, as well as forced GOT
entries for the sym_2_* symbols in the primary got.  Their high
dynindx, represented in the info field of the relocations, indicate
they're past the primary GOT symbols in the primary GOT, which is
intended since they're not referenced in code that uses the primary
GOT.

Since the patch is big, particularly with the testcase, I'm posting it
bzip2ed, except for the patch for include/elf, that's small enough and
unchanged since the first posting. Ok to install?

Index: include/elf/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* mips.h (EF_MIPS_XGOT): Define.

Index: include/elf/mips.h
===================================================================
RCS file: /cvs/uberbaum/include/elf/mips.h,v
retrieving revision 1.18
diff -u -p -r1.18 mips.h
--- include/elf/mips.h 31 Dec 2002 07:29:28 -0000 1.18
+++ include/elf/mips.h 13 Jan 2003 22:10:06 -0000
@@ -99,6 +99,9 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
    position independent code.  */
 #define EF_MIPS_CPIC		0x00000004
 
+/* ???  Unknown flag, set in IRIX 6's BSDdup2.o in libbsd.a.  */
+#define EF_MIPS_XGOT		0x00000008
+
 /* Code in file uses UCODE (obsolete) */
 #define EF_MIPS_UCODE		0x00000010
 

Attachment: bfd-mips-multi-got.patch.bz2
Description: BZip2 compressed data

Attachment: ld-mips-multi-got.patch.bz2
Description: BZip2 compressed data

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]