diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-04-11 11:30:31 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-04-22 11:27:52 +0200 |
commit | 499a60179657d2945c6ad01bdac90e8427a6310e (patch) | |
tree | 26ff831d11927295526948351ee6c732a3f4b389 /configure.ac | |
parent | 70f1eecdc12dbfc742f29844be215eacf51c5014 (diff) | |
download | glibc-499a60179657d2945c6ad01bdac90e8427a6310e.tar.gz glibc-499a60179657d2945c6ad01bdac90e8427a6310e.tar.xz glibc-499a60179657d2945c6ad01bdac90e8427a6310e.zip |
Default to --with-default-link=no (bug 25812)
This is necessary to place the libio vtables into the RELRO segment. New tests elf/tst-relro-ldso and elf/tst-relro-libc are added to verify that this is what actually happens. The new tests fail on ia64 due to lack of (default) RELRO support inbutils, so they are XFAILed there. (cherry picked from commit 198abcbb94618730dae1b3f4393efaa49e0ec8c7)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac index 87f67d25ec..228261a494 100644 --- a/configure.ac +++ b/configure.ac @@ -153,7 +153,7 @@ AC_ARG_WITH([default-link], AS_HELP_STRING([--with-default-link], [do not use explicit linker scripts]), [use_default_link=$withval], - [use_default_link=default]) + [use_default_link=no]) dnl Additional build flags injection. AC_ARG_WITH([nonshared-cflags], @@ -1402,59 +1402,6 @@ fi rm -f conftest*]) AC_SUBST(libc_cv_hashstyle) -# The linker's default -shared behavior is good enough if it -# does these things that our custom linker scripts ensure that -# all allocated NOTE sections come first. -if test "$use_default_link" = default; then - AC_CACHE_CHECK([for sufficient default -shared layout], - libc_cv_use_default_link, [dnl - libc_cv_use_default_link=no - cat > conftest.s <<\EOF - .section .note.a,"a",%note - .balign 4 - .long 4,4,9 - .string "GNU" - .string "foo" - .section .note.b,"a",%note - .balign 4 - .long 4,4,9 - .string "GNU" - .string "bar" -EOF - if AC_TRY_COMMAND([dnl - ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) && - ac_try=`$READELF -S conftest.so | sed -n \ - ['${x;p;} - s/^ *\[ *[1-9][0-9]*\] *\([^ ][^ ]*\) *\([^ ][^ ]*\) .*$/\2 \1/ - t a - b - : a - H']` - then - libc_seen_a=no libc_seen_b=no - set -- $ac_try - while test $# -ge 2 -a "$1" = NOTE; do - case "$2" in - .note.a) libc_seen_a=yes ;; - .note.b) libc_seen_b=yes ;; - esac - shift 2 - done - case "$libc_seen_a$libc_seen_b" in - yesyes) - libc_cv_use_default_link=yes - ;; - *) - echo >&AS_MESSAGE_LOG_FD "\ -$libc_seen_a$libc_seen_b from: -$ac_try" - ;; - esac - fi - rm -f conftest*]) - use_default_link=$libc_cv_use_default_link -fi - AC_CACHE_CHECK(for GLOB_DAT reloc, libc_cv_has_glob_dat, [dnl cat > conftest.c <<EOF |