diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-06-30 12:53:04 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-09-10 09:34:03 -0700 |
commit | f10bae9a102a00ec97a38d009013c5aa616c847f (patch) | |
tree | 7dfdbcbc287ad0d79ca93b324a76dd9c65d46c41 /configure | |
parent | 01b07c70ad77ef28b6a3661ed3142ebff35b6e69 (diff) | |
download | glibc-f10bae9a102a00ec97a38d009013c5aa616c847f.tar.gz |
Add STB_SECONDARY support to ld.sohjl/secondary/2.21
Enable STB_SECONDARY if it is supported by binutils. Add 3 STB_SECONDARY
tests.
* config.h.in: Add HAVE_ASM_SECONDARY_DIRECTIVE.
* config.make.in (have-secondary): New macro.
* configure.in: Check if STB_SECONDARY is supported by as/ld.
Define HAVE_ASM_SECONDARY_DIRECTIVE and set have-secondary to yes
if the .secondary assembly directive works.
* configure: Regenerated.
* elf/Makefile (tests): Add tst-secondary1 tst-secondary2
tst-secondary3 if STB_SECONDARY is supported by as/ld.
(modules-names): Add tst-secondarymod tst-secondary1mod
tst-secondary2mod tst-secondary3mod if STB_SECONDARY is supported
by as/ld.
(LDFLAGS-tst-secondarymod.so): New macro.
($(objpfx)tst-secondary1): New rule.
($(objpfx)tst-secondary2): Likewise.
($(objpfx)tst-secondary3): Likewise.
* elf/dl-addr.c (determine_info): Also check STB_SECONDARY.
* elf/dl-lookup.c (do_lookup_x): Handle STB_SECONDARY.
(_dl_lookup_symbol_x): Likewise.
* elf/sprof.c (read_symbols): Likewise.
* elf/elf.h (STB_SECONDARY): New.
(STB_NUM): Updated.
* elf/tst-secondary.h: New file.
* elf/tst-secondary1.c: Likewise.
* elf/tst-secondary1mod.c: Likewise.
* elf/tst-secondary2.c: Likewise.
* elf/tst-secondary2mod.c: Likewise.
* elf/tst-secondary3.c: Likewise.
* elf/tst-secondary3mod.c: Likewise.
* elf/tst-secondarymod.c: Likewise.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 69 |
1 files changed, 69 insertions, 0 deletions
@@ -623,6 +623,7 @@ libc_cv_cc_loop_to_function libc_cv_cc_submachine libc_cv_cc_nofma exceptions +libc_cv_ld_secondary gnu89_inline libc_cv_ssp fno_unit_at_a_time @@ -6333,8 +6334,10 @@ if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5' $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then libc_cv_asm_weak_directive=yes + libc_cv_asm_weak=.weak else libc_cv_asm_weak_directive=no + libc_cv_asm_weak= fi rm -f conftest* fi @@ -6363,6 +6366,7 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then libc_cv_asm_weakext_directive=yes + libc_cv_asm_weak=.weakext else libc_cv_asm_weakext_directive=no fi @@ -6381,6 +6385,71 @@ elif test $libc_cv_asm_weakext_directive = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .secondary assembler directive" >&5 +$as_echo_n "checking for .secondary assembler directive... " >&6; } +if ${libc_cv_asm_secondary_directive+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.s <<EOF +${libc_cv_dot_text} +_sym: +.secondary _sym +EOF +test -n "$libc_cv_asm_weak" && cat >> conftest.s <<EOF +$libc_cv_asm_weak _sym +EOF +if ${CC-cc} -c $ASFLAGS -o conftest.o conftest.s 1>&5 2>&5; then + if $READELF -s conftest.o | fgrep _sym | fgrep SECOND > /dev/null; then + libc_cv_asm_secondary_directive=yes + else + libc_cv_asm_secondary_directive=no + fi +else + libc_cv_asm_secondary_directive=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_secondary_directive" >&5 +$as_echo "$libc_cv_asm_secondary_directive" >&6; } +if test $libc_cv_asm_secondary_directive = yes; then + $as_echo "#define HAVE_ASM_SECONDARY_DIRECTIVE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for secondary symbol in shared library" >&5 +$as_echo_n "checking for secondary symbol in shared library... " >&6; } +if ${libc_cv_ld_secondary+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<EOF +asm (".secondary foo"); +void foo (void) { } +EOF + if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + -fPIC -shared -o conftest.so conftest.c + -nostartfiles -nostdlib + 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + if $READELF -s conftest.so | fgrep foo | fgrep SECOND > /dev/null; then + libc_cv_ld_secondary=yes + else + libc_cv_ld_secondary=no + fi + else + libc_cv_ld_secondary=no + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_secondary" >&5 +$as_echo "$libc_cv_ld_secondary" >&6; } +else + libc_cv_ld_secondary=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --no-whole-archive" >&5 $as_echo_n "checking for ld --no-whole-archive... " >&6; } if ${libc_cv_ld_no_whole_archive+:} false; then : |