This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] MIPS support for GNU hash
- From: Mihailo Stojanović <mihailo dot stojanovic at rt-rk dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Cc: Chenghua Xu <paul dot hua dot gm at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>, "Maciej W . Rozycki" <macro at linux-mips dot org>, Petar Jovanovic <petar dot jovanovic at rt-rk dot com>, Dragan Mladjenovic <dragan dot mladjenovic at rt-rk dot com>, Carlos O'Donell <carlos at redhat dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Tue, 23 Jul 2019 15:06:22 +0200
- Subject: Re: [PATCH v2] MIPS support for GNU hash
- References: <1562843158-31390-1-git-send-email-mihailo.stojanovic@rt-rk.com> <9b55f8ca-341b-d422-da11-a8a49f90377a@linaro.org>
Hello,
The corresponding binutils patch can be found here:
https://sourceware.org/ml/binutils/2019-07/msg00098.html
If I understood correctly this patch has not been pushed upstream, neither
in fact actually reviewed. My understanding is we require upstream support
for either kernel or toolchain features before including it on glibc, although
not sure about this specific feature where it really tied with binutils
support.
Carlos, do you think we should wait for binutils?
Binutils patch hasn't been pushed upstream, but it was reviewed in [1].
We are currently waiting on FSF to process the binutils assignment for
RT-RK [2].
@@ -955,6 +955,12 @@ _dl_setup_hash (struct link_map *map)
map->l_gnu_buckets = hash32;
hash32 += map->l_nbuckets;
map->l_gnu_chain_zero = hash32 - symbias;
+
+ /* Initialize MIPS xhash translation table. */
+#ifdef ELF_MACHINE_XHASH_SETUP
+ ELF_MACHINE_XHASH_SETUP (hash32, symbias, map)
+#endif
+
return;
}
I think it is better we move away from ifdef such kind of logic where possible
and just define ELF_MACHINE_XHASH_SETUP in the generic as an empty macro.
Acknowledged. Defined as an empty macro in the newly submitted
patch [3].
diff --git a/sysdeps/mips/linkmap.h b/sysdeps/mips/linkmap.h
index 1fb9678..1e640c3 100644
--- a/sysdeps/mips/linkmap.h
+++ b/sysdeps/mips/linkmap.h
@@ -3,4 +3,5 @@ struct link_map_machine
ElfW(Addr) plt; /* Address of .plt */
ElfW(Word) fpabi; /* FP ABI of the object */
unsigned int odd_spreg; /* Does the object require odd_spreg support? */
+ const Elf32_Word *mips_xlat_zero; /* .MIPS.xhash */
};
diff --git a/sysdeps/unix/sysv/linux/mips/ldsodefs.h b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
index 8dde855..ce7b2f9 100644
--- a/sysdeps/unix/sysv/linux/mips/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
@@ -34,7 +34,7 @@ extern void _dl_static_init (struct link_map *map);
#undef VALID_ELF_ABIVERSION
#define VALID_ELF_ABIVERSION(osabi,ver) \
(ver == 0 \
- || (osabi == ELFOSABI_SYSV && ver < 4) \
+ || (osabi == ELFOSABI_SYSV && ver < 6) \
|| (osabi == ELFOSABI_GNU && ver < LIBC_ABI_MAX))
#endif /* ldsodefs.h */
I presume the version 6 is to make room for the PT_GNU_STACK.
Actually, the jump from 4 to 5 should have happened when support
for absolute symbols was added to binutils [4], but it didn't, so I had
to address that here.
Cheers,
Mihailo
[1] https://sourceware.org/ml/binutils/2019-07/msg00055.html
[2] https://sourceware.org/ml/binutils/2019-07/msg00215.html
[3] https://sourceware.org/ml/libc-alpha/2019-07/msg00526.html
[4]
https://github.com/bminor/binutils-gdb/blob/bfa2a36d94d124eb7b54fd271a543047579b47ee/bfd/elfxx-mips.c#L16606