berkus / mclinker

Automatically exported from code.google.com/p/mclinker
Other
0 stars 0 forks source link

Fail to produce mips share object when link against .so with _gp_disp defined #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(1) Segmentation fault
llvm-mcld.debug -march=mipsel -shared test/Android/Plasma/MIPS/plasma.o  
test/Android/Plasma/MIPS/libplasma.golden.so

(2) But successfully link if change the order of .o and .so
llvm-mcld.debug -march=mipsel -shared 
test/Android/Plasma/MIPS/libplasma.golden.so test/Android/Plasma/MIPS/plasma.o

This is because that after symbol resolution, the symbol _gp_disp will be 
defined in (1) but undefined in (2). The defined _gp_disp in (1) will cause the 
MCLinker::defineAndResolveSymbolAsRefered return NULL for it directly and then 
fail to get _gp_disp's resolveInfo while MipsGNULDBackend::initTargetSymbols.

I'm not sure how we shall handle this case.

Original issue reported on code.google.com by mysekki on 1 Aug 2012 at 3:08

GoogleCodeExporter commented 9 years ago
Loop in Chao-Ying

Original comment by LubaTang on 1 Aug 2012 at 3:24

GoogleCodeExporter commented 9 years ago
plasma.o:
    55: 00000000     0 OBJECT  GLOBAL DEFAULT  UND _gp_disp

plasma.so: 
     1: 0000aba4     0 SECTION GLOBAL DEFAULT  ABS _gp_disp
    30: 0000aba4     0 SECTION GLOBAL DEFAULT  ABS _gp_disp

o (U), so (d_D): should be
use the dynamic definition if we have a reference. rise isDynamic, then change 
back the symbol as undefined as emission.

so (d_D), o (U): should be
remember the binding of the undefined. Do not override the symbol. rise 
isDynamic.

Original comment by LubaTang on 1 Aug 2012 at 3:55

GoogleCodeExporter commented 9 years ago
Bug fixed at Revieion 33274295d1db and Revision 4828821e443c.

Original comment by LubaTang on 1 Aug 2012 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by mysekki on 1 Aug 2012 at 4:20