public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: sajcho <saux.aarch64@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: binutils-2.36.1 BTI PLT with only GNU PROP
Date: Sun, 14 Feb 2021 23:19:52 +1030	[thread overview]
Message-ID: <20210214124952.GI5348@bubble.grove.modra.org> (raw)
In-Reply-To: <CAKdqWuOyA9Gk5PMQyOz+T_WV9Cb3zmPFwgqjrfpiO=Pew-UJ3g@mail.gmail.com>

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

       reply	other threads:[~2021-02-14 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKdqWuOyA9Gk5PMQyOz+T_WV9Cb3zmPFwgqjrfpiO=Pew-UJ3g@mail.gmail.com>
2021-02-14 12:49 ` Alan Modra [this message]
2021-02-14 14:54 ` Fwd: " sajcho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210214124952.GI5348@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=saux.aarch64@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).