[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/14326] New: Cannot link to etext symbol in scripttempl/pe.sc
From: |
kkimlabs at gmail dot com |
Subject: |
[Bug ld/14326] New: Cannot link to etext symbol in scripttempl/pe.sc |
Date: |
Tue, 03 Jul 2012 08:52:40 +0000 |
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: address@hidden
ReportedBy: address@hidden
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 ld/14326] New: Cannot link to etext symbol in scripttempl/pe.sc,
kkimlabs at gmail dot com <=