-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Landley wrote:
> If I enable CTOR/DTOR support, I get undefined _init and _fini.  I don't 
> remember which .o file those two are in, but it's linking in the same group 
> as 
> all the other targets and those work, sh4 doesn't.
> 
> # gcc -v thread-hello2.c -lpthread
> ...
> /usr/bin/../lib/crt1.o: In function `_start':
> (.text+0x24): undefined reference to `_init'
> /usr/bin/../lib/crt1.o: In function `_start':
> (.text+0x28): undefined reference to `_fini'
> collect2: ld returned 1 exit status
> 

Hi Rob,
sorry for the dummy question... are you compiling on a sh4 box I
imagine, aren't you ?

> When I disassemble crti.o on i686, I see definitions of _init and _fini, but 
> when I disassemble crti.o on sh4, the functions are called .init and .fini:
> 
> / # objdump -d /usr/lib/crti.o
> 
> /usr/lib/crti.o:     file format elf32-sh-linux
> 
> Disassembly of section .init:
> 
> 00000000 <.init>:
>    0: c6 2f           mov.l   r12,@-r15
>    2: e6 2f           mov.l   r14,@-r15
>    4: 22 4f           sts.l   pr,@-r15
>    6: f3 6e           mov     r15,r14
>    8: 00 a0           bra     0xc
>    a: 09 00           nop     
> Disassembly of section .fini:
> 
> 00000000 <.fini>:
>    0: c6 2f           mov.l   r12,@-r15
>    2: e6 2f           mov.l   r14,@-r15
>    4: 22 4f           sts.l   pr,@-r15
>    6: f3 6e           mov     r15,r14
>    8: 00 a0           bra     0xc
>    a: 09 00           nop     
> 
> I looked at uClibc/libc/sysdeps/linux/sh/crti.S  and tried removing the 
> "hidden" directives for both those, but it didn't help.
> 
> Any clues?
> 
> Rob
> _______________________________________________
> uClibc mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/uclibc
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmixYgACgkQoRq/3BrK1s+l7wCgmvdGW9YumfSsNPEEzALRRN5x
MTsAoJ1rHihQmjzknEQJvlm/3xW1PM47
=dDoz
-----END PGP SIGNATURE-----
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to