https://sourceware.org/bugzilla/show_bug.cgi?id=30813
Bug ID: 30813
Summary: Compilation Fails Due to the Use of Protected Symbols
Product: binutils
Version: 2.40
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: chenhaixiang3 at huawei dot com
Target Milestone: ---
Hi
I'm having a problem with binutils version 2.40 .
After switching to binutils version 2.40, the following cases fail to compile
successfully:
```
$cat protected1moda.c
int protected1 = 3;
asm (".protected protected1");
void
set_protected1a (int i)
{
protected1 = i;
}
$cat protected1a.c
#include
extern int protected1;
void
main (void)
{
protected1 = 1;
}
$gcc protected1moda.c -shared -fPIC -o protected1moda.so
$gcc protected1a.c -fPIE protected1moda.so
```
At this point, the compilation results in the following error:
/usr/bin/ld: /tmp/ccPvtTxE.o: copy relocation against non-copyable protected
symbol `protected1' in protected1moda.so
collect2: error: ld returned 1 exit status
However, this error is not present in binutils version 2.37.
Is this a feature of version 2.40? If it is, how should I modify my case to
address this issue?
Thanks
--
You are receiving this mail because:
You are on the CC list for the bug.