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]

Re: C++ and PIC code generation...


Hi Scott

>The above code works on x86 if doit() is in a shared library.  On ARM Linux,
>doit() aborts if it is in a shared library.  The code aborts calling
>__eh_rtime_match.  The problem seems to be the code generated by the compiler
>when -fPIC is passed.  On the ARM it generates:
>
>	bl  __eh_rtime_match
>
>AFAIK, it should generate:
>
>	bl  __eh_rtime_match(PLT)

I get the expected results (ie PLT mentioned in the assembler file) on both 
ARM and x86.

$ g++ -E exceptlib.cpp -o exceptlib.ii
$ g++ -O0 -g exceptlib.ii -S -fPIC -o exceptlib.s
$ grep eh_rtime exceptlib.s 
.globl __eh_rtime_match
        call __eh_rtime_match@PLT
$ arm-linux-g++ -O0 -g exceptlib.ii -S -fPIC -o exceptlib.s
$ grep eh_rtime exceptlib.s 
        bl      __eh_rtime_match(PLT)
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
$ arm-linux-g++ -v
Reading specs from /usr/local/lib/gcc-lib/arm-linux/2.95.3/specs
gcc version 2.95.3 19991030 (prerelease)
$

I haven't checked whether your program actually runs, though.  I'll do that 
later.

p.



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