This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/32621] New: undefined weak sym test broken when pic
- From: "amodra at bigpond dot net dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2007 05:34:26 -0000
- Subject: [Bug target/32621] New: undefined weak sym test broken when pic
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
extern int foo () __attribute__ ((weak));
extern int bar __attribute__ ((weak));
int
main ()
{
if (foo)
foo ();
if (&bar)
bar++;
return 0;
}
When compiled with -fPIC, the tests for non-zero foo and bar address have a pic
adjustment made before comparing against zero. If the code is run at an
address other than where it was linked this will result in foo being called
when it is undefined, and similarly for bar.
--
Summary: undefined weak sym test broken when pic
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amodra at bigpond dot net dot au
GCC target triplet: spu-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32621