* [PATCH] Fix checking of ld.so undefined symbols on sparc64
@ 2007-08-16 20:13 Jakub Jelinek
2007-08-16 20:23 ` Roland McGrath
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2007-08-16 20:13 UTC (permalink / raw)
To: Roland McGrath, Ulrich Drepper; +Cc: Glibc hackers
Hi!
The nm -u ld.so | cmp -s /dev/null -
test fails on sparc64, because ld.so (and other shared libs) on sparc64
have STT_REGISTER SHN_UNDEF symbols which are supposed to be undefined
per psABI and are not really any kind of errors, just notes about
each library's use of global registers.
Using readelf -s allows us to filter symbols which can be SHN_UNDEF
(symbol 0 and STT_REGISTER).
Ok?
2007-08-16 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile ($(objpfx)ld.so): Use readelf -s and awk instead of nm -u
to check for undefined symbols.
--- libc/elf/Makefile.jj 2007-08-10 15:31:49.000000000 +0200
+++ libc/elf/Makefile 2007-08-16 22:08:21.000000000 +0200
@@ -307,7 +307,9 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld
$(filter-out $(map-file),$^) $(load-map-file) \
-Wl,-soname=$(rtld-installed-name) -T $@.lds
rm -f $@.lds
- nm -u $@ | cmp -s /dev/null -
+ readelf -s $@ \
+ | awk '($7 ~ /^UND(|EF)$/ && $1 != "0:" && $4 != "REGISTER") { print }' \
+ | cmp -s /dev/null -
# interp.c exists just to get this string into the libraries.
CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix checking of ld.so undefined symbols on sparc64
2007-08-16 20:13 [PATCH] Fix checking of ld.so undefined symbols on sparc64 Jakub Jelinek
@ 2007-08-16 20:23 ` Roland McGrath
2007-08-16 20:28 ` Jakub Jelinek
0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2007-08-16 20:23 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers
Might as well just use { print; exit 2 } in the awk.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix checking of ld.so undefined symbols on sparc64
2007-08-16 20:23 ` Roland McGrath
@ 2007-08-16 20:28 ` Jakub Jelinek
2007-08-16 21:17 ` Roland McGrath
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2007-08-16 20:28 UTC (permalink / raw)
To: Roland McGrath; +Cc: Ulrich Drepper, Glibc hackers
On Thu, Aug 16, 2007 at 01:23:03PM -0700, Roland McGrath wrote:
> Might as well just use { print; exit 2 } in the awk.
Well, that would print just one line, we want to see all undefined
symbols, don't we?
But
awk '($7 ~ /^UND(|EF)$/ && $1 != "0:" && $4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
could work...
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix checking of ld.so undefined symbols on sparc64
2007-08-16 20:28 ` Jakub Jelinek
@ 2007-08-16 21:17 ` Roland McGrath
0 siblings, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2007-08-16 21:17 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers
> On Thu, Aug 16, 2007 at 01:23:03PM -0700, Roland McGrath wrote:
> > Might as well just use { print; exit 2 } in the awk.
>
> Well, that would print just one line, we want to see all undefined
> symbols, don't we?
> But
> awk '($7 ~ /^UND(|EF)$/ && $1 != "0:" && $4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
> could work...
Sure. I just meant no need for the cmp when using awk.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-16 21:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-16 20:13 [PATCH] Fix checking of ld.so undefined symbols on sparc64 Jakub Jelinek
2007-08-16 20:23 ` Roland McGrath
2007-08-16 20:28 ` Jakub Jelinek
2007-08-16 21:17 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).