http://sourceware.org/bugzilla/show_bug.cgi?id=14326
Bug #: 14326
Summary: Cannot link to etext symbol in scripttempl/pe.sc
Product: binutils
Version: 2.22
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: kkiml...@gmail.com
Classification: Unclassified
For the following main.cpp
#include
using namespace std;
extern int etext;
int main(void)
{
cout << (int*) &etext << endl;
return 0;
}
compiling:
$ i686-w64-mingw32-g++ main.cpp -Wl,-verbose | grep PROVIDE
PROVIDE (etext = .);
PROVIDE (end = .);
PROVIDE ( _end = .);
/tmp/ccVghwrB.o:main.cpp:(.text+0x3fb): undefined reference to `etext'
collect2: error: ld returned 1 exit status
$ x86_64-w64-mingw32-g++ main.cpp -Wl,-verbose | grep PROVIDE
PROVIDE (etext = .);
PROVIDE (end = .);
PROVIDE ( _end = .);
$
so i686-w64-mingw32-g++ fails to link etext. I'm not sure what's the problem
exactly. Here is the a part of irc chat with ktietz on #mingw-w64:
then do you think it's a bug?
it is a bug in i686's pe.sc
the symbol exported there has to be _etext, too
as a C symbol for 32-bit has to have an leading underscore, but pe.sc
(from binutils' ld) just provides symbol 'etext'. So it is unreachable
btw for 64-bit it works, as here no underscore as prefixed for C
symbols
kkimlabs_ file a bug for it to binutils' bugzilla and add me to it CC
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils