glibc/sysdeps/mips
Mihailo Stojanovic 23c1c256ae MIPS support for GNU hash
This patch is a reimplementation of [1], which was submitted back in
2015. Copyright issue has been sorted [2] last year. It proposed a new
section (.gnu.xhash) and related dynamic tag (GT_GNU_XHASH). The new
section would be virtually identical to the existing .gnu.hash except
for the translation table (xlat) which would contain correct MIPS
.dynsym indexes corresponding to the hashvals in chains. This is because
MIPS ABI imposes a different ordering of the dynsyms than the one
expected by the .gnu.hash section. Another addition would be a leading
word at the beggining of the section, which would contain the number of
entries in the translation table.

In this patch, the new section name and dynamic tag are changed to
reflect the fact that the section should be treated as MIPS specific
(.MIPS.xhash and DT_MIPS_XHASH).

This patch addresses the alignment issue reported in [3] which is caused
by the leading word of the .MIPS.xhash section. Leading word is now
removed in the corresponding binutils patch, and the number of entries
in the translation table is computed using DT_MIPS_SYMTABNO dynamic tag.

Since the MIPS specific dl-lookup.c file was removed following the
initial patch submission, I opted for the definition of three new macros
in the generic ldsodefs.h. ELF_MACHINE_GNU_HASH_ADDRIDX defines the
index of the dynamic tag in the l_info array. ELF_MACHINE_HASH_SYMIDX is
used to calculate the index of a symbol in GNU hash. On MIPS, it is
defined to look up the symbol index in the translation table.
ELF_MACHINE_XHASH_SETUP is defined for MIPS only. It initializes the
.MIPS.xhash pointer in the link_map_machine struct.

The other major change is bumping the highest EI_ABIVERSION value for
MIPS to suggest that the dynamic linker now supports GNU hash.

The patch was tested by running the glibc testsuite for the three MIPS
ABIs (o32, n32 and n64) and for x86_64-linux-gnu.

[1] https://sourceware.org/ml/binutils/2015-10/msg00057.html
[2] https://sourceware.org/ml/binutils/2018-03/msg00025.html
[3] https://sourceware.org/ml/binutils/2016-01/msg00006.html

	* elf/dl-addr.c (determine_info): Calculate the symbol index
	using the newly defined ELF_MACHINE_HASH_SYMIDX macro.
	* elf/dl-lookup.c (do_lookup_x): Ditto.
	(_dl_setup_hash): Initialize MIPS xhash translation table.
	* elf/elf.h (SHT_MIPS_XHASH): New define.
	(DT_MIPS_XHASH): New define.
	* sysdeps/generic/ldsodefs.h (ELF_MACHINE_GNU_HASH_ADDRIDX): New
	define.
	(ELF_MACHINE_HASH_SYMIDX): Ditto.
	(ELF_MACHINE_XHASH_SETUP): Ditto.
	* sysdeps/mips/ldsodefs.h (ELF_MACHINE_GNU_HASH_ADDRIDX): New
	define.
	(ELF_MACHINE_HASH_SYMIDX): Ditto.
	(ELF_MACHINE_XHASH_SETUP): Ditto.
	* sysdeps/mips/linkmap.h (struct link_map_machine): New member.
	* sysdeps/unix/sysv/linux/mips/ldsodefs.h: Increment valid ABI
	version.
	* sysdeps/unix/sysv/linux/mips/libc-abis: New ABI version.
2019-08-29 20:11:42 +00:00
..
bits Declare most TS 18661-1 interfaces for C2X. 2019-08-13 11:28:51 +00:00
fpu Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ieee754 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
include/sys Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mips32 Break more lines before not after operators. 2019-02-25 13:19:19 +00:00
mips64 Break more lines before not after operators. 2019-02-25 13:19:19 +00:00
nofpu Do not define various fenv.h macros for MIPS soft-float (bug 23479). 2018-08-02 15:53:29 +00:00
nptl Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sys Don't put non-ASCII into installed headers 2019-08-23 14:19:40 -07:00
__longjmp.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
abort-instr.h Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
add_n.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
addmul_1.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
atomic-machine.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
configure Require autoconf 2.69 2014-09-29 07:53:36 -07:00
configure.ac Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-machine-reject-phdr.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-machine.h Add and move fall-through comments in system-specific code. 2019-02-26 02:09:18 +00:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-tls.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-trampoline.c Add and move fall-through comments in system-specific code. 2019-02-26 02:09:18 +00:00
fpregdef.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fpu_control.h Don't put non-ASCII into installed headers 2019-08-23 14:19:40 -07:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Implies Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ldbl-classify-compat.h Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
ldsodefs.h MIPS support for GNU hash 2019-08-29 20:11:42 +00:00
libc-tls.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
linkmap.h MIPS support for GNU hash 2019-08-29 20:11:42 +00:00
localplt.data Add localplt.data for MIPS. 2016-11-04 16:40:54 +00:00
lshift.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Makefile [MIPS] Raise highest supported EI_ABIVERSION value [BZ #24916] 2019-08-23 16:47:27 +00:00
math-tests-snan-payload.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memcpy.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mul_1.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
nan-high-order-bit.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
preconfigure Remove --with-fp / --without-fp. 2017-12-12 13:56:47 +00:00
regdef.h Don't put non-ASCII into installed headers 2019-08-23 14:19:40 -07:00
rshift.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
setjmp_aux.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sgidefs.h Don't put non-ASCII into installed headers 2019-08-23 14:19:40 -07:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
start.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
strcmp.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sub_n.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tininess.h Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
tls-macros.h MIPS: Only use .set mips* assembler directives when necessary 2015-09-08 16:52:43 +01:00
tst-abi-fp32mod.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-abi-fp64amod.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-abi-fp64mod.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-abi-fpxxmod.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-abi-fpxxomod.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-abi-interlink.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-audit.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-mode-switch-1.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-mode-switch-2.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-mode-switch-3.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-undefined-weak-lib.S [MIPS] Raise highest supported EI_ABIVERSION value [BZ #24916] 2019-08-23 16:47:27 +00:00
tst-undefined-weak.c [MIPS] Raise highest supported EI_ABIVERSION value [BZ #24916] 2019-08-23 16:47:27 +00:00