[Development] how to reduce the relocation <-- Use static qt libraries

song.7.liu at nokia.com song.7.liu at nokia.com
Tue Jul 24 09:44:37 CEST 2012


More information that from gcc the "-Wl,-Bsymbolic" can be used to bind references to global symbols to the definition within the so, if any.
So what's the symbolic consideration for ARM toolchain in qt ?

Thanks,
Song

-----Original Message-----
From: development-bounces+song.7.liu=nokia.com at qt-project.org [mailto:development-bounces+song.7.liu=nokia.com at qt-project.org] On Behalf Of Liu Song.7 (Nokia-MP/Beijing)
Sent: Tuesday, July 24, 2012 2:40 PM
To: Storm-Olsen Marius (Nokia-MP/Austin); thiago.macieira at intel.com; development at qt-project.org
Subject: Re: [Development] how to reduce the relocation <-- Use static qt libraries

Hi,

Finally we can build out and load the libqt5.so successfully, but the loading is still very slow because too many symbols are to be relocated.
Even many of these relocated symbols are inside the libqt5.so, we suppose they should be resolved during the link time instead of loading time.

And let's take the analogclock (from qtbase/examples/widgets) for example:

void AnalogClock::paintEvent(QPaintEvent *) {
    ... ...
}

This paintEvent is implemented inside the analogclock.cpp, but "readelf -r analogclock" shows that:

Relocation section '.rel.dyn' at offset 0x1b08 contains 72 entries:                                  
 Offset     Info    Type            Sym.Value  Sym. Name
... ...
0000b090  00006f02 R_ARM_ABS32       00002933   _ZN11AnalogClock10pain
... ...

We think this is not expected, so is there a way to avoid such unnecessary relocation ?

Btw, I already test to build the qt with "-reduce-relocation" but still got same result.

Thanks,
Song

-----Original Message-----
From: Mcgovern Rohan (Nokia-MP/Brisbane)
Sent: Tuesday, July 24, 2012 12:23 PM
To: Liu Song.7 (Nokia-MP/Beijing)
Cc: Lan Peng-Peter (Nokia-MP/Beijing); Storm-Olsen Marius (Nokia-MP/Austin); development; thiago.macieira
Subject: RE: [Development] Use static qt libraries
Importance: High

Liu Song.7 (Nokia-MP/Beijing) said:
> Thanks, are such undefined symbols normal ? And is there a way to fix it ?

Right now, the only thing which comes to mind is if you have somehow mixed some -frtti and -fno-rtti objects.

> 
> -----Original Message-----
> From: Mcgovern Rohan (Nokia-MP/Brisbane)
> Sent: Tuesday, July 24, 2012 11:58 AM
> To: Liu Song.7 (Nokia-MP/Beijing)
> Cc: Lan Peng-Peter (Nokia-MP/Beijing); Storm-Olsen Marius 
> (Nokia-MP/Austin); development; thiago.macieira
> Subject: Re: [Development] Use static qt libraries
> Importance: High
> 
> song.7.liu at nokia.com said:
> > Hi,
> > 
> > Now we can build out the single libqt5.so (using ARM toolchain) by:
> >     
> >     "OPTS += -static"  to create the static qt libs
> >     "ar -x libQtXX.a" to extract the .o files
> >     "armlink --fpic --shared *.o -o libqt5.so" to generate final 
> > single so
> > 
> > But the "readelf -s libqt5.so | grep UND":
> > 
> >      4: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI12QFocusHelper
> >      5: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI17QAbstractUndoItem
> >      6: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI19QStaticTextUserData
> >      7: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI22QItemEditorCreatorB
> >      8: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI26QAbstractDynamicMet
> >      9: 00000000     0 OBJECT  WEAK   DEFAULT  UND _ZTI28QNetworkConfigurati
> > 
> > Does anyone know what is this mangled symbol "_ZTIXX" in C++ ?
> > 
> 
> The 'c++filt' program can answer this.
> 
>   $ echo _ZTI12QFocusHelper | c++filt
>   typeinfo for QFocusHelper
_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list