Subject: CVS commit: basesrc/libexec/ld.elf_so/arch/mips
To: None <source-changes@netbsd.org>
From: Charles M. Hannum <mycroft@netbsd.org>
List: source-changes
Date: 09/25/2002 06:52:09
Module Name:	basesrc
Committed By:	mycroft
Date:		Wed Sep 25 03:52:07 UTC 2002

Modified Files:
	basesrc/libexec/ld.elf_so/arch/mips: mips_reloc.c

Log Message:
Resolve the GOT before doing relocations.  Then, when doing relocations, for
symbols in the global part of the symbol table, use the updated GOT entry
rather than doing a lookup.  (This provides the same effect as `-z combreloc'
on other platforms -- at most one lookup is done per symbol.)

Unfortunately, it is necessary to turn off lazy binding on MIPS.  As the
comment says:

                         * XXX DANGER WILL ROBINSON!
                         * You might think this is stupid, as it intentionally
                         * defeats lazy binding -- and you'd be right.
                         * Unfortunately, for lazy binding to work right, we
                         * need to a way to force the GOT slots used for
                         * function pointers to be resolved immediately.  This
                         * is supposed to be done automatically by the linker,
                         * by not outputting a PLT slot and setting st_value
                         * to 0, but GNU ld does not do so reliably.


To generate a diff of this commit:
cvs rdiff -r1.33 -r1.34 basesrc/libexec/ld.elf_so/arch/mips/mips_reloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.