[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/30768] X86: copy relocation against non-copyable protected symbo
From: |
xiezhiheng at huawei dot com |
Subject: |
[Bug ld/30768] X86: copy relocation against non-copyable protected symbol |
Date: |
Thu, 17 Aug 2023 03:30:35 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=30768
--- Comment #2 from xiezhiheng <xiezhiheng at huawei dot com> ---
(In reply to H.J. Lu from comment #1)
> I have
>
> have-protected-data = no
>
> in config.make. What do you have?
In my config.make, have-protected-data = yes
Oh I think I find something interesting. Thanks a lot for the hint.
Normally for checking linker support for protected data symbol, it gets
failure.
configure:6698: checking linker support for protected data symbol
configure:6709: gcc -nostdlib -nostartfiles -fno-stack-protector -fPIC -shared
conftest.c -o conftest.so
configure:6712: $? = 0
configure:6719: gcc -nostdlib -nostartfiles -fno-stack-protector conftest.c -o
conftest conftest.so
/usr/bin/ld: error: /tmp/ccU1Z7bY.o: cannot make copy relocation for protected
symbol 'bar', defined in conftest.so
collect2: error: ld returned 1 exit status
configure:6722: $? = 1
configure:6730: result: no
But in my building system, for safety reasons, we add -fPIC option globally in
some way. So it would be like
gcc -nostdlib -nostartfiles -fno-stack-protector -fPIC -shared conftest.c -o
conftest.so
gcc -nostdlib -nostartfiles -fno-stack-protector conftest.c -o conftest
conftest.so -fPIC
and it passes.
I think it may be the key point for the failure.
--
You are receiving this mail because:
You are on the CC list for the bug.