Hi,
I've reproduced it on kernel x86 selftests.
To do it, run:
$ cd linux/tools/testing/selftests/x86
$ make `pwd`/sysret_ss_attrs_64
Which results in the same error:
root@x86-64-debian:~/x86# make
/root/linux/tools/testing/selftests/x86/sysret_ss_attrs_64
gcc -m64 -o /root/linux/tools/testing/selftests/x86/sysret_ss_attrs_64
-O2 -g -std=gnu99 -pthread -Wall sysret_ss_attrs.c thunks.S -lrt -ldl
/usr/bin/ld: /tmp/ccVOq79r.o: relocation R_X86_64_32S against `.text'
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target
'/root/linux/tools/testing/selftests/x86/sysret_ss_attrs_64' failed
make: *** [/root/linux/tools/testing/selftests/x86/sysret_ss_attrs_64]
Error 1
With:
root@x86-64-debian:~/x86# gcc --version
gcc (Debian 6.3.0-16) 6.3.0 20170425
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Note, that this bug seems to be only Debian-related.
I've check on other distributions (Arch Linux, Fedora) - that works
with gcc (GCC) 6.3.1 20170306.
Also I did check vanilla gcc with this release commit:
commit 4b5e15daff8b (HEAD, tag: gcc-6_3_0-release)
Author: gccadmin <gccadmin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Dec 21 07:51:43 2016 +0000
Update ChangeLog and version files for release
git-svn-id:
svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243836
138bc75d-0d04-0410-961f-82ee72b054a4
--
Dmitry