[qt] qboosh! help :-)

Paweł Sikora pluto w ds14.agh.edu.pl
Sob, 17 Kwi 2004, 19:27:07 CEST


ostatnio adgor i djurban nie moga zbudowac qt na gcc34 (jakie maja
wersje glibca (2.3.3/2.3.4/nptl/tls) i binutilsow to nie wiem.

adgor zbudowal u siebie libqt-mt.so.3.3.1 z debugiem (-O0 -g),
ale niestety biblioteka nie jest do konca dobrze zlinkowana.
g++ ./libqt-mt.so.3.3.1 pokazuje brak symbolu .LPR3

nieszczesny .LPR3 uzywany jest przez:

tools/qconfig.o
tools/qdeepcopy.o
tools/qunicodetables.o
kernel/qpaintdevicemetrics.o
kernel/qtaddons_x11.o
kernel/qmngio.o
kernel/qjpegio.o
kernel/qpngio.o

wzialem na ruszt qconfig.cpp jako najbardziej ;) zlozony:

/* Install paths from configure */

static const char QT_INSTALL_PREFIX[267] =
	"qt_nstpath=/usr";
static const char QT_INSTALL_BINS[267] =
	"qt_binpath=/usr/bin";
static const char QT_INSTALL_DOCS[267] =
	"qt_docpath=/usr/share/doc/qt-doc";
static const char QT_INSTALL_HEADERS[267] =
	"qt_hdrpath=/usr/include/qt";
static const char QT_INSTALL_LIBS[267] =
	"qt_libpath=/usr/lib";
static const char QT_INSTALL_PLUGINS[267] =
	"qt_plgpath=/usr/lib/qt/plugins-mt";
static const char QT_INSTALL_DATA[267] =
	"qt_datpath=/usr/share/qt";
static const char QT_INSTALL_TRANSLATIONS[267] =
	"qt_trnpath=/usr/share/locale/";
static const char QT_INSTALL_SYSCONF[267] =
	"qt_cnfpath=/etc/qt";

/* strlen( "qt_xxxpath=" ) == 11 */
const char *qInstallPath()          { return QT_INSTALL_PREFIX       + 11; }
const char *qInstallPathDocs()      { return QT_INSTALL_DOCS         + 11; }
const char *qInstallPathHeaders()   { return QT_INSTALL_HEADERS      + 11; }
const char *qInstallPathLibs()      { return QT_INSTALL_LIBS         + 11; }
const char *qInstallPathBins()      { return QT_INSTALL_BINS         + 11; }
const char *qInstallPathPlugins()   { return QT_INSTALL_PLUGINS      + 11; }
const char *qInstallPathData()      { return QT_INSTALL_DATA         + 11; }
const char *qInstallPathTranslations(){ return QT_INSTALL_TRANSLATIONS + 11; }
const char *qInstallPathSysconf()   { return QT_INSTALL_SYSCONF      + 11; }

qconfig.o:     file format elf32-i386

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000008 R_386_PC32        .LPR3
0000000e R_386_GOTPC       _GLOBAL_OFFSET_TABLE_
(...)

Disassembly of section .text:

00000000 <_ZSt17__verify_groupingPKcjRKSs>:
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	53                   	push   %ebx
   4:	83 ec 24             	sub    $0x24,%esp
   7:	e8 fc ff ff ff       	call   8 <_ZSt17__verify_groupingPKcjRKSs+0x8>
           ^^^^^^^^^^^ tu laduje .LPR3

   c:	81 c3 02 00 00 00    	add    $0x2,%ebx
              ^^^^^^^^^^^ a tu laduje _GLOBAL_OFFSET_TABLE_

==================================================================
widac wyraznie, ze nie jest to fragment zrodel qconfig.cpp,
ktorych kod zaczyna sie kawalek dalej. co wiecej jest to fragment
kodu wyraznie zwiazany z -fPIC'em. zeby bylo ciekawiej,
to analogiczny plik zbudowany na mojej maszynie, wyglada tak samo,
tylko, relokoacja jest inna (poprawna).

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000008 R_386_PC32        __i686.get_pc_thunk.bx
0000000e R_386_GOTPC       _GLOBAL_OFFSET_TABLE_

Disassembly of section .text:

00000000 <_ZSt17__verify_groupingPKcjRKSs>:
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	53                   	push   %ebx
   4:	83 ec 24             	sub    $0x24,%esp
   7:	e8 fc ff ff ff       	call   8 <_ZSt17__verify_groupingPKcjRKSs+0x8>
           ^^^^^^^^^^^ __i686.get_pc_thunk.bx
   c:	81 c3 02 00 00 00    	add    $0x2,%ebx
              ^^^^^^^^^^^ _GLOBAL_OFFSET_TABLE_
  12:	8b 45 10             	mov    0x10(%ebp),%eax
  15:	89 04 24             	mov    %eax,(%esp)
        (...)
==================================================================

(cd. kodu z maszyny adgora)

  12:	8b 45 10             	mov    0x10(%ebp),%eax
  15:	89 04 24             	mov    %eax,(%esp)
  18:	e8 fc ff ff ff       	call   19 <_ZSt17__verify_groupingPKcjRKSs+0x19>
  1d:	48                   	dec    %eax
  1e:	89 45 f8             	mov    %eax,0xfffffff8(%ebp)
  21:	8b 45 0c             	mov    0xc(%ebp),%eax
  24:	48                   	dec    %eax
  25:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
  28:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
  2b:	89 44 24 04          	mov    %eax,0x4(%esp)
  2f:	8d 45 f8             	lea    0xfffffff8(%ebp),%eax
  32:	89 04 24             	mov    %eax,(%esp)
  35:	e8 fc ff ff ff       	call   36 <_ZSt17__verify_groupingPKcjRKSs+0x36>
  3a:	8b 00                	mov    (%eax),%eax
  3c:	89 45 f4             	mov    %eax,0xfffffff4(%ebp)
  3f:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
  42:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
  45:	c6 45 eb 01          	movb   $0x1,0xffffffeb(%ebp)
  49:	c7 45 e4 00 00 00 00 	movl   $0x0,0xffffffe4(%ebp)
  50:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
  53:	3b 45 f4             	cmp    0xfffffff4(%ebp),%eax
  56:	73 39                	jae    91 <_ZSt17__verify_groupingPKcjRKSs+0x91>
  58:	80 7d eb 00          	cmpb   $0x0,0xffffffeb(%ebp)
  5c:	74 33                	je     91 <_ZSt17__verify_groupingPKcjRKSs+0x91>
  5e:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
  61:	89 44 24 04          	mov    %eax,0x4(%esp)
  65:	8b 45 10             	mov    0x10(%ebp),%eax
  68:	89 04 24             	mov    %eax,(%esp)
  6b:	e8 fc ff ff ff       	call   6c <_ZSt17__verify_groupingPKcjRKSs+0x6c>
  70:	89 c1                	mov    %eax,%ecx
  72:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
  75:	8b 55 08             	mov    0x8(%ebp),%edx
  78:	01 c2                	add    %eax,%edx
  7a:	0f b6 01             	movzbl (%ecx),%eax
  7d:	3a 02                	cmp    (%edx),%al
  7f:	0f 94 c0             	sete   %al
  82:	88 45 eb             	mov    %al,0xffffffeb(%ebp)
  85:	8d 45 ec             	lea    0xffffffec(%ebp),%eax
  88:	ff 08                	decl   (%eax)
  8a:	8d 45 e4             	lea    0xffffffe4(%ebp),%eax
  8d:	ff 00                	incl   (%eax)
  8f:	eb bf                	jmp    50 <_ZSt17__verify_groupingPKcjRKSs+0x50>
  91:	83 7d ec 00          	cmpl   $0x0,0xffffffec(%ebp)
  95:	74 34                	je     cb <_ZSt17__verify_groupingPKcjRKSs+0xcb>
  97:	80 7d eb 00          	cmpb   $0x0,0xffffffeb(%ebp)
  9b:	74 2e                	je     cb <_ZSt17__verify_groupingPKcjRKSs+0xcb>
  9d:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
  a0:	89 44 24 04          	mov    %eax,0x4(%esp)
  a4:	8b 45 10             	mov    0x10(%ebp),%eax
  a7:	89 04 24             	mov    %eax,(%esp)
  aa:	e8 fc ff ff ff       	call   ab <_ZSt17__verify_groupingPKcjRKSs+0xab>
  af:	89 c1                	mov    %eax,%ecx
  b1:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
  b4:	8b 55 08             	mov    0x8(%ebp),%edx
  b7:	01 c2                	add    %eax,%edx
  b9:	0f b6 01             	movzbl (%ecx),%eax
  bc:	3a 02                	cmp    (%edx),%al
  be:	0f 94 c0             	sete   %al
  c1:	88 45 eb             	mov    %al,0xffffffeb(%ebp)
  c4:	8d 45 ec             	lea    0xffffffec(%ebp),%eax
  c7:	ff 08                	decl   (%eax)
  c9:	eb c6                	jmp    91 <_ZSt17__verify_groupingPKcjRKSs+0x91>
  cb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  d2:	00 
  d3:	8b 45 10             	mov    0x10(%ebp),%eax
  d6:	89 04 24             	mov    %eax,(%esp)
  d9:	e8 fc ff ff ff       	call   da <_ZSt17__verify_groupingPKcjRKSs+0xda>
  de:	89 c1                	mov    %eax,%ecx
  e0:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
  e3:	8b 55 08             	mov    0x8(%ebp),%edx
  e6:	01 c2                	add    %eax,%edx
  e8:	0f b6 01             	movzbl (%ecx),%eax
  eb:	3a 02                	cmp    (%edx),%al
  ed:	7f 0c                	jg     fb <_ZSt17__verify_groupingPKcjRKSs+0xfb>
  ef:	0f b6 45 eb          	movzbl 0xffffffeb(%ebp),%eax
  f3:	83 e0 01             	and    $0x1,%eax
  f6:	88 45 e3             	mov    %al,0xffffffe3(%ebp)
  f9:	eb 04                	jmp    ff <_ZSt17__verify_groupingPKcjRKSs+0xff>
  fb:	c6 45 e3 00          	movb   $0x0,0xffffffe3(%ebp)
  ff:	0f b6 45 e3          	movzbl 0xffffffe3(%ebp),%eax
 103:	88 45 eb             	mov    %al,0xffffffeb(%ebp)
 106:	0f b6 45 eb          	movzbl 0xffffffeb(%ebp),%eax
 10a:	83 c4 24             	add    $0x24,%esp
 10d:	5b                   	pop    %ebx
 10e:	5d                   	pop    %ebp
 10f:	c3                   	ret    

00000110 <_Z12qInstallPathv>:
 110:	55                   	push   %ebp
 111:	89 e5                	mov    %esp,%ebp
 113:	e8 be 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 118:	81 c1 02 00 00 00    	add    $0x2,%ecx
 11e:	8d 81 2b 00 00 00    	lea    0x2b(%ecx),%eax
 124:	5d                   	pop    %ebp
 125:	c3                   	ret    

00000126 <_Z16qInstallPathDocsv>:
 126:	55                   	push   %ebp
 127:	89 e5                	mov    %esp,%ebp
 129:	e8 a8 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 12e:	81 c1 02 00 00 00    	add    $0x2,%ecx
 134:	8d 81 6b 02 00 00    	lea    0x26b(%ecx),%eax
 13a:	5d                   	pop    %ebp
 13b:	c3                   	ret    

0000013c <_Z19qInstallPathHeadersv>:
 13c:	55                   	push   %ebp
 13d:	89 e5                	mov    %esp,%ebp
 13f:	e8 92 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 144:	81 c1 02 00 00 00    	add    $0x2,%ecx
 14a:	8d 81 8b 03 00 00    	lea    0x38b(%ecx),%eax
 150:	5d                   	pop    %ebp
 151:	c3                   	ret    

00000152 <_Z16qInstallPathLibsv>:
 152:	55                   	push   %ebp
 153:	89 e5                	mov    %esp,%ebp
 155:	e8 7c 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 15a:	81 c1 02 00 00 00    	add    $0x2,%ecx
 160:	8d 81 ab 04 00 00    	lea    0x4ab(%ecx),%eax
 166:	5d                   	pop    %ebp
 167:	c3                   	ret    

00000168 <_Z16qInstallPathBinsv>:
 168:	55                   	push   %ebp
 169:	89 e5                	mov    %esp,%ebp
 16b:	e8 66 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 170:	81 c1 02 00 00 00    	add    $0x2,%ecx
 176:	8d 81 4b 01 00 00    	lea    0x14b(%ecx),%eax
 17c:	5d                   	pop    %ebp
 17d:	c3                   	ret    

0000017e <_Z19qInstallPathPluginsv>:
 17e:	55                   	push   %ebp
 17f:	89 e5                	mov    %esp,%ebp
 181:	e8 50 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 186:	81 c1 02 00 00 00    	add    $0x2,%ecx
 18c:	8d 81 cb 05 00 00    	lea    0x5cb(%ecx),%eax
 192:	5d                   	pop    %ebp
 193:	c3                   	ret    

00000194 <_Z16qInstallPathDatav>:
 194:	55                   	push   %ebp
 195:	89 e5                	mov    %esp,%ebp
 197:	e8 3a 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 19c:	81 c1 02 00 00 00    	add    $0x2,%ecx
 1a2:	8d 81 eb 06 00 00    	lea    0x6eb(%ecx),%eax
 1a8:	5d                   	pop    %ebp
 1a9:	c3                   	ret    

000001aa <_Z24qInstallPathTranslationsv>:
 1aa:	55                   	push   %ebp
 1ab:	89 e5                	mov    %esp,%ebp
 1ad:	e8 24 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 1b2:	81 c1 02 00 00 00    	add    $0x2,%ecx
 1b8:	8d 81 0b 08 00 00    	lea    0x80b(%ecx),%eax
 1be:	5d                   	pop    %ebp
 1bf:	c3                   	ret    

000001c0 <_Z19qInstallPathSysconfv>:
 1c0:	55                   	push   %ebp
 1c1:	89 e5                	mov    %esp,%ebp
 1c3:	e8 0e 00 00 00       	call   1d6 <_Z19qInstallPathSysconfv+0x16>
 1c8:	81 c1 02 00 00 00    	add    $0x2,%ecx
 1ce:	8d 81 2b 09 00 00    	lea    0x92b(%ecx),%eax
 1d4:	5d                   	pop    %ebp
 1d5:	c3                   	ret    

podejzewam ze przez ta wesola zabawe z PIC'em wyklada sie takze
klasa QThread z bledem 'costam local storage bodajze 4000'.

kompilator mamy ten sam (gcc-3.4.0-0.20040414.1)
poza tym mam glibc-2.3.4-0.20040415.1+nptl(+tls) i binutils-2.15.90.0.1.1-1
jakie ma adgor nie wiem, bo dzis juz pomknal bawic.

g++ mieli tak samo w obu przypadkach. jedynie linkerowi dorzucam
niestandardowa flage -z combreloc.

jakas pomysla ?

-- 
If you think of MS-DOS as mono, and Windows as stereo,
  then Linux is Dolby Digital and all the music is free...



Więcej informacji o liście dyskusyjnej pld-devel-pl