This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/32621] New: undefined weak sym test broken when pic


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]