* include/libc-symbols.h (stub_warning): Emit a marker section called
	.gnu.glibc-stub.NAME.
	* Makerules ($(objpfx)stubs): Depend on object files, not dep files.
	Use objdump to collect those marker section names.
	($(common-objpfx)shlib.lds): Discard .gnu.glibc-stub.* sections.
This commit is contained in:
Roland McGrath 2005-02-11 00:29:55 +00:00
parent 5d9e899182
commit 561bcb8086
3 changed files with 21 additions and 16 deletions

View File

@ -1,5 +1,12 @@
2005-02-10 Roland McGrath <roland@redhat.com> 2005-02-10 Roland McGrath <roland@redhat.com>
[BZ #157]
* include/libc-symbols.h (stub_warning): Emit a marker section called
.gnu.glibc-stub.NAME.
* Makerules ($(objpfx)stubs): Depend on object files, not dep files.
Use objdump to collect those marker section names.
($(common-objpfx)shlib.lds): Discard .gnu.glibc-stub.* sections.
* Rules (subdir_objs, subdir_stubs): New phony targets. * Rules (subdir_objs, subdir_stubs): New phony targets.
* Makefile (+subdir_targets): Add them. * Makefile (+subdir_targets): Add them.

View File

@ -492,7 +492,7 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
PROVIDE(__start___libc_freeres_ptrs = .); \ PROVIDE(__start___libc_freeres_ptrs = .); \
*(__libc_freeres_ptrs) \ *(__libc_freeres_ptrs) \
PROVIDE(__stop___libc_freeres_ptrs = .);/'\ PROVIDE(__stop___libc_freeres_ptrs = .);/'\
-e 's/^.*\*(\.jcr).*$$/& \ -e 's@^.*\*(\.jcr).*$$@& \
PROVIDE(__start___libc_subfreeres = .);\ PROVIDE(__start___libc_subfreeres = .);\
__libc_subfreeres : { *(__libc_subfreeres) }\ __libc_subfreeres : { *(__libc_subfreeres) }\
PROVIDE(__stop___libc_subfreeres = .);\ PROVIDE(__stop___libc_subfreeres = .);\
@ -501,7 +501,8 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
PROVIDE(__stop___libc_atexit = .);\ PROVIDE(__stop___libc_atexit = .);\
PROVIDE(__start___libc_thread_subfreeres = .);\ PROVIDE(__start___libc_thread_subfreeres = .);\
__libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\ __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
PROVIDE(__stop___libc_thread_subfreeres = .);/' PROVIDE(__stop___libc_thread_subfreeres = .);\
/DISCARD/ : { *(.gnu.glibc-stub.*) }@'
mv -f $@T $@ mv -f $@T $@
common-generated += shlib.lds common-generated += shlib.lds
@ -1385,19 +1386,15 @@ ifdef objpfx
.PHONY: stubs # The parent Makefile calls this target. .PHONY: stubs # The parent Makefile calls this target.
stubs: $(objpfx)stubs stubs: $(objpfx)stubs
endif endif
$(objpfx)stubs: $(+depfiles) objs-for-stubs := $(foreach o,$(object-suffixes-for-libc),$(o-objects)) \
ifneq (,$(strip $(+depfiles))) $(addprefix $(objpfx),$(extra-objs))
# Use /dev/null since `...` might expand to empty. $(objpfx)stubs: $(objs-for-stubs)
c=`($(patsubst %/,cd % &&,$(objpfx)) \ ifneq (,$(strip $(objs-for-stubs)))
sed -n -e 's@\$$(common-objpfx)@$(common-objpfx)@g' \ $(OBJDUMP) -h $^ | \
-e 's@\$$(objpfx)@$(objpfx)@g' \ $(AWK) '/\.gnu\.glibc-stub\./ { \
-e '/stub-tag\.h/{; g; s/./&/p; }' \ sub(/\.gnu\.glibc-stub\./, "", $$2); \
-e '/:/{x; s/^.*$$//; x; }' \ stubs[$$2] = 1; } \
-e 's/^.*://;s/\\$$//;s/^ *\([^ ][^ ]*\) .*$$/\1/' \ END { for (s in stubs) print "#define __stub_" s }' > $@T
-e '/^[^ ][^ ]*$$/{G;s/^.*\n\(..*\)/\1/;s/\n//;h; }' \
$(patsubst $(objpfx)%,%,$^)) | sort | uniq`; \
sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
$$c /dev/null > $@T
mv -f $@T $@ mv -f $@T $@
else else
> $@ > $@

View File

@ -1,6 +1,6 @@
/* Support macros for making weak and strong aliases for symbols, /* Support macros for making weak and strong aliases for symbols,
and for using symbol sets and linker warnings with GNU ld. and for using symbol sets and linker warnings with GNU ld.
Copyright (C) 1995-1998,2000-2003,2004 Free Software Foundation, Inc. Copyright (C) 1995-1998,2000-2003,2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -279,6 +279,7 @@
/* A canned warning for sysdeps/stub functions. */ /* A canned warning for sysdeps/stub functions. */
#define stub_warning(name) \ #define stub_warning(name) \
__make_section_unallocated (".gnu.glibc-stub." #name) \
link_warning (name, \ link_warning (name, \
"warning: " #name " is not implemented and will always fail") "warning: " #name " is not implemented and will always fail")