[PATCH] sh: Add PIC implementation for crt1.S

Carmelo AMOROSO carmelo.amoroso at st.com
Tue May 5 17:20:31 UTC 2009


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

Peter Griffin wrote:
> On Fri, 2009-05-01 at 17:56 +0200, Carmelo Amoroso wrote:
>> Peter Griffin wrote:
>>>> Hi Pete,
>>>> I tried you patch but I cannot link a pie application (simple hello)
>>>> due to linker error as below:
>>>>
>>>> /opt/STM/STLinux-2.3/devkit/sh4_uclibc/lib/gcc/sh4-linux-uclibc/4.2.4/../../../../sh4-linux-uclibc/bin/ld:
>>>> /opt/STM/STLinux-2.3/devkit/sh4_uclibc/target/usr/lib/Scrt1.o(.text+0x40):
>>>> unresolvable R_SH_GOTOFF relocation against symbol `__uClibc_main'
>>>> /opt/STM/STLinux-2.3/devkit/sh4_uclibc/lib/gcc/sh4-linux-uclibc/4.2.4/../../../../sh4-linux-uclibc/bin/ld:
>>>> final link failed: Nonrepresentable section on output
>>>> collect2: ld returned 1 exit status
>>>>
>>>> I've fixed your patch... GOTOFF relocation should be used for static
>>>> data access, not for function call. I've fixed it by using a GOT
>>>> entry. I've linked a pie hello application and I do not have any
>>>> TEXTREL.
>>>> Please may you try my version (attached) on your system.
>>>>
>>>> Thanks,
>>>> Carmelo
>>> Hi Carmelo,
>>>
>>> Sorry about the delay in getting back to you. I'm having problems
>>> recreating the toolchain I used to build the SH2A PIC binaries. Nothing
>>> to do with the patch or your changes.
>>>
>>> I should have submitted the patch a couple of weeks ago when I had
>>> everything still on my system :-(
>>>
>>> I'll let you know when I get it going.
>>>
>>> regards,
>>>
>>> Peter.
>>>
>> Ok,
>> I'm using the modify version of your patch on MMU sh4/nptl system
>> without problem, and indeed it solved the issue with dbus.
>> I'd like to have just one patch working fin for sh2a; so I'll wait
>> your feedback before committing it.
>>
>> Thanks,
>> Carmelo
>>
> Hi Carmelo,
> 
> I sorted out my toolchain problem and tested the patch with your changes.
> It works fine on SH2A with a PIE hello program. 
> 
> I'm glad the patch also helped to solve your problem :-)
> 
> Cheers,
> 
> Pete.
> 
> 
Applied to git (master/nptl).

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

iEYEARECAAYFAkoAdV8ACgkQoRq/3BrK1s+6VgCfUwqY+NiPtPY0IP/iYMea98oo
UtQAoPacYFIXEP5FuD9togiY1QSvZ9nF
=i/y1
-----END PGP SIGNATURE-----


More information about the uClibc mailing list