This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH v2] MIPS support for GNU hash


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


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