linux/tools/testing/selftests/exec
Yang Yingliang 4d1cd3b2c5 tools/testing/selftests/exec: fix link error
Fix the link error by adding '-static':

  gcc -Wall  -Wl,-z,max-page-size=0x1000 -pie load_address.c -o /home/yang/linux/tools/testing/selftests/exec/load_address_4096
  /usr/bin/ld: /tmp/ccopEGun.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `stderr@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: /tmp/ccopEGun.o(.text+0x158): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `stderr@@GLIBC_2.17'
  /usr/bin/ld: final link failed: bad value
  collect2: error: ld returned 1 exit status
  make: *** [Makefile:25: tools/testing/selftests/exec/load_address_4096] Error 1

Link: https://lkml.kernel.org/r/20210514092422.2367367-1-yangyingliang@huawei.com
Fixes: 206e22f019 ("tools/testing/selftests: add self-test for verifying load alignment")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc: Chris Kennelly <ckennelly@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-22 15:09:07 -10:00
..
.gitignore tools/testing/selftests: add self-test for verifying load alignment 2020-10-16 11:11:21 -07:00
binfmt_script selftests/exec: Add binfmt_script regression test 2020-05-21 10:24:39 -05:00
execveat.c selftests/exec: Verify execve of non-regular files fail 2020-05-22 09:29:00 -06:00
load_address.c tools/testing/selftests: add self-test for verifying load alignment 2020-10-16 11:11:21 -07:00
Makefile tools/testing/selftests/exec: fix link error 2021-05-22 15:09:07 -10:00
non-regular.c selftests/exec: add file type errno tests 2020-08-14 19:56:56 -07:00
recursion-depth.c exec selftests: test ->recursion_depth 2019-05-14 19:52:50 -07:00