Go to file
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
argp
assert
benchtests
bits login: Add nonstring attributes to struct utmp, struct utmpx [BZ #24899] 2019-08-15 16:09:43 +02:00
catgets
ChangeLog.old Correct the spelling of more contributors 2019-08-29 02:50:04 -07:00
conform
crypt
csu
ctype
debug Refactor sigcontextinfo.h 2019-08-23 11:30:56 -03:00
dirent
dlfcn
elf MIPS support for GNU hash 2019-08-29 20:11:42 +00:00
gmon linux: Make profil_counter a compat_symbol (BZ#17726) 2019-08-23 11:30:56 -03:00
gnulib
grp
gshadow
hesiod
htl
hurd
iconv
iconvdata
include Do not print backtraces on fatal glibc errors 2019-08-19 15:41:29 +02:00
inet
intl
io
libio
locale
localedata Chinese locales: Set first_weekday to 2 (bug 24682). 2019-08-23 00:07:06 +02:00
login login: pututxline could fail to overwrite existing entries [BZ #24902] 2019-08-28 11:59:45 +02:00
mach
malloc malloc: Various cleanups for malloc/tst-mxfast 2019-08-15 11:37:18 +02:00
manual Correct the spelling of more contributors 2019-08-29 02:50:04 -07:00
math Fix spellings of contributor names in comments and doc 2019-08-23 13:11:05 -07:00
mathvec
misc misc: Use allocate_once in getmntent 2019-08-28 12:01:48 +02:00
nis
nptl nptl: Move pthread_attr_setdetachstate implementation into libc 2019-08-28 12:01:14 +02:00
nptl_db
nscd nscd: Improve nscd.conf comments. 2019-08-19 09:57:58 -04:00
nss nss: Make nsswitch.conf more distribution friendly. 2019-08-19 09:56:59 -04:00
po
posix Fix posix/tst-regex by using UTF-8 and own test input 2019-08-29 02:38:14 -07:00
pwd
resolv Mark IDN tests unsupported with libidn2 before 2.0.5. 2019-08-22 12:56:49 +00:00
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp Correct the spelling of more contributors 2019-08-29 02:50:04 -07:00
stdio-common
stdlib Fix spellings of contributor names in comments and doc 2019-08-23 13:11:05 -07:00
string Fix spellings of contributor names in comments and doc 2019-08-23 13:11:05 -07:00
sunrpc
support support: Include <support/descriptors.h> in support_descriptors.c 2019-08-14 16:24:46 +02:00
sysdeps MIPS support for GNU hash 2019-08-29 20:11:42 +00:00
sysvipc
termios
time Don't use the argument to time. 2019-08-21 08:26:36 -04:00
timezone
wcsmbs
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4
ChangeLog MIPS support for GNU hash 2019-08-29 20:11:42 +00:00
config.h.in
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig
Makefile
Makefile.in
Makerules
NEWS Add tgmath.h macros for narrowing functions. 2019-08-21 12:06:44 +00:00
o-iterator.mk
README
Rules
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.