The following example(reduced from glibc) compiles differently for ppc target
when using gcc 4.2 as compared to gcc 4.1
It generates the alias symbol as a real symbol instead of creating it as alias.
I get this correct using gcc 4.2 for arm so the problem seems to be affecting
only ppc. This also works ok with gcc 4.1

to reproduce compile the example with -O2

testcase.c
========================================================
extern char **_dl_argv

     __attribute__ ((section (".data.rel.ro")))

     ;

extern char **_dl_argv_internal __attribute__ ((visibility ("hidden")))

     __attribute__ ((section (".data.rel.ro")))

     ;
char **_dl_argv __attribute__ ((section (".data.rel.ro"))) = ((void *)0);
extern __typeof (_dl_argv) _dl_argv_internal __attribute__ ((alias
("_dl_argv")));
char* foo (){
   return _dl_argv_internal[0];
}

=====================================

glibc segfaults in ld.so currently when compiled with gcc 4.2 for ppc due to
this issue.


-- 
           Summary: gcc generate incorrect alias symbols for PPC
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raj dot khem at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: powerpc-*-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29943

Reply via email to