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: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
For the following main.cpp
#include <iostream>
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:
<kkimlabs_> then do you think it's a bug?
<ktietz> it is a bug in i686's pe.sc
<ktietz> the symbol exported there has to be _etext, too
<ktietz> 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
<ktietz> btw for 64-bit it works, as here no underscore as prefixed for C
symbols
<ktietz> 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
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils