https://sourceware.org/bugzilla/show_bug.cgi?id=19803
Bug ID: 19803
Summary: gc-sections breaks PE DLL variable export
Product: binutils
Version: 2.26
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: martin.koegler at chello dot at
Target Milestone: ---
--gc-sections is still broken for variables:
d1.cpp:
====
extern const long testval[2] = {1, 2};
====
d2.cpp:
===
#include <stdio.h>
extern const long testval[];
int main()
{
printf("%p\n", testval);
printf("%d %d\n", testval[0], testval[1]);
return 0;
}
====
x86_64-w64-mingw32-g++ -o d1a.dll -shared d1.cpp -Wl,--out-implib
-Wl,d1a.dll.a -Wl,--gc-sections
x86_64-w64-mingw32-g++ -o d1b.dll -shared d1.cpp -Wl,--out-implib
-Wl,d1b.dll.a
x86_64-w64-mingw32-g++ -o d2a.exe d2.cpp d1a.dll.a => Crashes
x86_64-w64-mingw32-g++ -o d2A.exe d2.cpp d1a.dll => prints incorrect data
x86_64-w64-mingw32-g++ -o d2b.exe d2.cpp d1b.dll.a => OK
x86_64-w64-mingw32-g++ -o d2B.exe d2.cpp d1b.dll => OK
See https://sourceware.org/ml/binutils/2016-03/msg00112.html for a test case,
which shows this bug in libstdc++.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils