binutils-2.36.1 BTI PLT with only GNU PROP

Alan Modra amodra@gmail.com
Sun Feb 14 12:49:52 GMT 2021


On Sun, Feb 14, 2021 at 10:39:40AM +0100, sajcho wrote:
> Hi Alan.
> 
> When I run the binutils-2.36.1 test, I still get the same error.
> Can you help me with the interpretation of this error and how to eliminate
> it.

My guess would be that there is a bug in the testsuite, that one or
more of your --enable-* options change the expected testcase
addresses.  That should be fixable by adding appropriate linker
options to the testcase.

Note that you should really be asking questions on the binutils
mailing list.  I'm no aarch64 expert.  Someone else might give a more
accurate answer, and even fix the testcase.  Also, other people might
have the same question.

> Here is the relevant part with the test log and gcc binutils configuration
> used during compilation:
> 
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-unknown-linux-gnu/10.2.0/lto-wrapper
> Target: aarch64-unknown-linux-gnu
> Configured with:
> ../gcc-10.2.0/configure \
> --prefix=/usr \
> --libexecdir=/usr/lib \
> --enable-languages=c,c++,objc,fortran \
> --enable-threads=posix \
> --enable-__cxa_atexit \
> --enable-clocale=gnu \
> --enable-default-pie \
> --enable-default-ssp \
> --enable-fix-cortex-a53-835769 \
> --enable-fix-cortex-a53-843419 \
> --enable-gnu-unique-object \
> --enable-linker-build-id \
> --enable-shared \
> --enable-plugin \
> --disable-nls \
> --disable-multilib \
> --disable-libssp \
> --disable-libquadmath \
> --disable-libquadmath-support \
> --disable-libstdcxx-pch \
> --with-arch=armv8-a \
> --with-abi=lp64 \
> --with-system-zlib \
> --with-linker-hash-style=gnu \
> --with-pkgversion='SAUX Aarch64'
> 
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 10.2.0 (SAUX Aarch64)
> 
> 
> 
> Binutils version 2.36.1
> 
> configure \
> --prefix=/usr \
> --enable-ld=default \
> --enable-gold=no \
> --enable-plugins \
> --enable-threads \
> --enable-relro \
> --enable-secureplt \ # ??? PowerPC
> --enable-64-bit-bfd \
> --enable-install-libiberty \
> --enable-deterministic-archives \
> --enable-default-hash-style=gnu \
> --disable-nls \
> --disable-shared \
> --disable-werror \
> --disable-multilib \
> --disable-gdb \
> --with-pic \
> --with-mmap \
> --with-system-zlib \
> --with-pkgversion="SAUX Aarch64"
> 
> Building use:
> 
> CFLAGS="-O2 -march=armv8-a -mharden-sls=all -pipe"
> CXXFLAGS="-O2 -march=armv8-a -mharden-sls=all -pipe"
> 
> 
> Executing on host: sh -c {./ld-new -z norelro
> -L/home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64
> -z force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so -o tmpdir/dump
> tmpdir/bti-plt-1.o  2>&1}  /devspawn [open ...]
> /home/saux-devel/testing/binutils/work/src/build/ld/../binutils/readelf  -n
> tmpdir/dump > tmpdir/dump.out
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../binutils/readelf  -n
> tmpdir/dump > tmpdir/dump.out 2>dump.tmp}  /dev/null  (timeout = 300)
> spawn [open ...]
> PASS: Check -z force-bti emits BTI feature (exec)
> 
> 
> /home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_bti__=1  -o tmpdir/property-bti-pac1.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64/property-bti-pac1.s
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_bti__=1  -o tmpdir/property-bti-pac1.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarspawn
> [open ...]
> ./ld-new -z norelro
> -L/home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64
> -e _start -L./tmpdir -lbti-plt-so -o tmpdir/dump tmpdir/property-bti-pac1.o
> Executing on host: sh -c {./ld-new -z norelro
> -L/home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64
> -e _start -L./tmpdir -lbti-plt-so -o tmpdir/dump tmpdir/property-bti-pac1.o
> 2>&1}  /dev/null dump.tmp (timspawn [open ...]
> /home/saux-devel/testing/binutils/work/src/build/ld/../binutils/objdump  -dr
> -j .plt tmpdir/dump > tmpdir/dump.out
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../binutils/objdump
>  -dr
> -j .plt tmpdir/dump > tmpdir/dump.out 2>dump.tmp}  /dev/null  (timeout =
> 300)
> spawn [open ...]
> regexp_diff match failure
> regexp "^.*:    f9421611        ldr     x17, \[x16, #1064\]$"
> line   "  40029c:       f9420611        ldr     x17, [x16, #1032]"
> regexp_diff match failure
> regexp "^.*:    9110a210        add     x16, x16, #0x428$"
> line   "  4002a0:       91102210        add     x16, x16, #0x408"
> regexp_diff match failure
> regexp "^.*:    f9421a11        ldr     x17, \[x16, #1072\]$"
> line   "  4002b8:       f9420a11        ldr     x17, [x16, #1040]"
> regexp_diff match failure
> regexp "^.*:    9110c210        add     x16, x16, #0x430$"
> line   "  4002bc:       91104210        add     x16, x16, #0x410"
> 
> 
> FAIL: BTI PLT with only GNU PROP
> 
> 
> /home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_pac__=1  -o tmpdir/property-bti-pac2.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64/property-bti-pac2.s
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_pac__=1  -o tmpdir/property-bti-pac2.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarspawn
> [open ...]
> /home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_pac__=1  -o tmpdir/property-bti-pac1.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64/property-bti-pac1.s
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../gas/as-new
>  -mabi=lp64
> -defsym __property_pac__=1  -o tmpdir/property-bti-pac1.o
> /home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarspawn
> [open ...]
> ./ld-new -z norelro
> -L/home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64
> -shared -z force-bti -o tmpdir/dump tmpdir/property-bti-pac2.o
> tmpdir/property-bti-pac1.o
> Executing on host: sh -c {./ld-new -z norelro
> -L/home/saux-devel/testing/binutils/work/src/binutils-2.36.1/ld/testsuite/ld-aarch64
> -shared -z force-bti -o tmpdir/dump tmpdir/property-bti-pac2.o
> tmpdir/property-bti-pac1.o  2>&1}  /dev/nullspawn [open ...]
> ./ld-new: tmpdir/property-bti-pac2.o: warning: BTI turned on by -z force-bti
> when all inputs do not have BTI in NOTE section.
> succeeded with: <./ld-new: tmpdir/property-bti-pac2.o: warning: BTI turned
> on
> by -z force-bti when all inputs do not have BTI in NOTE section.>, expected:
> <.*property-bti-pac2.*: warning: BTI turned on by -z force-bti.*$>
> /home/saux-devel/testing/binutils/work/src/build/ld/../binutils/readelf  -n
> tmpdir/dump > tmpdir/dump.out
> Executing on host: sh -c
> {/home/saux-devel/testing/binutils/work/src/build/ld/../binutils/readelf  -n
> tmpdir/dump > tmpdir/dump.out 2>dump.tmp}  /dev/null  (timeout = 300)
> spawn [open ...]
> 
> Regards
> 
> Milan Buska

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list