This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/52634] multiple definition error when using alias
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Mar 2012 14:42:33 +0000
- Subject: [Bug lto/52634] multiple definition error when using alias
- Auto-submitted: auto-generated
- References: <bug-52634-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52634
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-20
Ever Confirmed|0 |1
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-20 14:42:33 UTC ---
Reduced testcase:
t1.c
----
extern int cfliteValueCallBacks;
void baz (int *);
int main () { baz(&cfliteValueCallBacks); }
t2.c
----
int cfliteKeyCallBacks = 5;
extern int cfliteValueCallBacks __attribute__((alias("cfliteKeyCallBacks")));
fails as:
gcc-4.7 -flto -flto-partition=1to1 t1.c t2.c -r -nostdlib
/tmp/ccPs2Uvd.ltrans1.ltrans.o:(.bss+0x0): multiple definition of
`cfliteKeyCallBacks'
/tmp/ccPs2Uvd.ltrans0.ltrans.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Not sure if the source is valid by design.