On Thu, 1 Apr 1999, Jamie Guinan wrote:
> My first test of this new egcs was to build GTK's GLIB, and
> I've got some troubles,
>
> $ ./testglib
> BUG IN DYNAMIC LINKER ld.so: ../sysdeps/arm/dl-machine.h: 450:
> elf_machine_rel: Assertion `! "unexpected dynamic reloc type"' failed!
I studied this some more today. I found that one difference
between the libraries compiled with egcs 1.1.2 release and
the "mainline" egcs snapshot is that in the latter case a handful
of R_ARM_PC24 reloc's show up, as evidenced by "objdump -R",
/tmp/testEgcs1/lib/libglib-1.2.so.0.0.0: file format elf32-arm
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
00022398 R_ARM_PC24 __div0
0002244c R_ARM_PC24 __div0
00022500 R_ARM_PC24 __div0
0002d494 R_ARM_RELATIVE *ABS*
0002d574 R_ARM_RELATIVE *ABS*
0002d5a8 R_ARM_RELATIVE *ABS*
...
I'm guessing the R_ARM_PC24 reloc's are what ld.so is choking on,
judging by ld.so's error message (actually, /lib/ld-linux.so.2).
Should the compiler be generating R_ARM_PC24 reloc's at all?
Here are the relocation locations (objdump -d),
00022394 <Ldiv0>:
22394: e52de004 str lr, [sp, -#4]!
22398: ebfffffe bl 22398 <Ldiv0+0x4>
2239c: e3a00000 mov r0, #0
223a0: e8bd8000 ldmia sp!, {pc}
...
00022448 <Ldiv0>:
22448: e52de004 str lr, [sp, -#4]!
2244c: ebfffffe bl 2244c <Ldiv0+0x4>
22450: e3a00000 mov r0, #0
22454: e8bd8000 ldmia sp!, {pc}
...
000224fc <Ldiv0>:
224fc: e52de004 str lr, [sp, -#4]!
22500: ebfffffe bl 22500 <Ldiv0+0x4>
22504: e3a00000 mov r0, #0
22508: e8bd8000 ldmia sp!, {pc}
I found that Ldiv0 is referenced only by __divsi3 and __udivsi3.
The modules that generate references to __divsi3 and __udivsi3 are
gdate.c and gmain.c.
You can find a pre-processed .i version of gmain.c at
http://www.bluebutton.com/jamie/gtk/gmain.i.gz
Compile it with,
$ gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib -g \
-O2 -Wall -D_REENTRANT -c -fPIC -DPIC gmain.i -o gmain.lo
And you should get,
$ ls -l gmain.lo
-rw-r--r-- 1 guinan guinan 50900 Apr 1 19:22 gmain.lo
$ sum gmain.lo
56134 50
Compiler version:
$ gcc -v
gcc version egcs-2.93.14 19990328 (gcc2 ss-980929 experimental)
(with Phil's egcs-990331-diff patch)
Thanks for your time,
-Jamie
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]