Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: vDSO: fix ELF hash table entry size for s390x

The vDSO self tests fail on s390x for a vDSO linked with the GNU linker
ld as follows:

# ./vdso_test_gettimeofday
Floating point exception (core dumped)

On s390x the ELF hash table entries are 64 bits instead of 32 bits in
size (see Glibc sysdeps/unix/sysv/linux/s390/bits/elfclass.h).

Fixes: 40723419f407 ("kselftest: Enable vDSO test on non x86 platforms")
Reported-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

authored by

Jens Remus and committed by
Jason A. Donenfeld
14be4e6f 8072b39c

+10 -4
+10 -4
tools/testing/selftests/vDSO/parse_vdso.c
··· 36 36 #define ELF_BITS_XFORM(bits, x) ELF_BITS_XFORM2(bits, x) 37 37 #define ELF(x) ELF_BITS_XFORM(ELF_BITS, x) 38 38 39 + #ifdef __s390x__ 40 + #define ELF_HASH_ENTRY ELF(Xword) 41 + #else 42 + #define ELF_HASH_ENTRY ELF(Word) 43 + #endif 44 + 39 45 static struct vdso_info 40 46 { 41 47 bool valid; ··· 53 47 /* Symbol table */ 54 48 ELF(Sym) *symtab; 55 49 const char *symstrings; 56 - ELF(Word) *bucket, *chain; 57 - ELF(Word) nbucket, nchain; 50 + ELF_HASH_ENTRY *bucket, *chain; 51 + ELF_HASH_ENTRY nbucket, nchain; 58 52 59 53 /* Version table */ 60 54 ELF(Versym) *versym; ··· 121 115 /* 122 116 * Fish out the useful bits of the dynamic table. 123 117 */ 124 - ELF(Word) *hash = 0; 118 + ELF_HASH_ENTRY *hash = 0; 125 119 vdso_info.symstrings = 0; 126 120 vdso_info.symtab = 0; 127 121 vdso_info.versym = 0; ··· 139 133 + vdso_info.load_offset); 140 134 break; 141 135 case DT_HASH: 142 - hash = (ELF(Word) *) 136 + hash = (ELF_HASH_ENTRY *) 143 137 ((uintptr_t)dyn[i].d_un.d_ptr 144 138 + vdso_info.load_offset); 145 139 break;