diff mbox

[U-Boot,3/4] arm920t: fix linker skript for -pie linking

Message ID 1291099039-49672-4-git-send-email-andreas.devel@googlemail.com
State Superseded
Delegated to: Wolfgang Denk
Headers show

Commit Message

Andreas Bießmann Nov. 30, 2010, 6:37 a.m. UTC
Without this patch the linker will SEGFAULT on some undefined weak
symbols.

Suggested-by: Sebastien Carlier <sebastien.carlier@gmail.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---
 arch/arm/cpu/arm920t/u-boot.lds |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Wolfgang Denk Dec. 8, 2010, 10:52 p.m. UTC | #1
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1291099039-49672-4-git-send-email-andreas.devel@googlemail.com> you wrote:
> Without this patch the linker will SEGFAULT on some undefined weak
> symbols.
> 
> Suggested-by: Sebastien Carlier <sebastien.carlier@gmail.com>
> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
> ---
>  arch/arm/cpu/arm920t/u-boot.lds |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Andreas Bießmann Dec. 9, 2010, 7:24 a.m. UTC | #2
Dear Wolfgang Denk,

Am 08.12.2010 um 23:52 schrieb Wolfgang Denk:

> Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
> 
> In message <1291099039-49672-4-git-send-email-andreas.devel@googlemail.com> you wrote:
>> Without this patch the linker will SEGFAULT on some undefined weak
>> symbols.
>> 
>> Suggested-by: Sebastien Carlier <sebastien.carlier@gmail.com>
>> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
>> ---
>> arch/arm/cpu/arm920t/u-boot.lds |    3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
> 
> Applied, thanks.

Please do not apply that patch! I'm sorry I have split up the thread cause it lead to a generic timer discussion. Therefore I posted v2 of this patch series here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/89974

This patch is not needed, if no undefined weak symbol is available.
This patch adds .plt/.rel.plt section which has R_ARM_JUMP_SLOT which is not handled in code. Therefore we do not really know what this patch does to the code, it was mostly a patch to handle the linker segfault described several times.

regards

Andreas Bießmann
Albert ARIBAUD Dec. 9, 2010, 7:33 a.m. UTC | #3
Le 09/12/2010 08:24, Andreas Bießmann a écrit :
> Dear Wolfgang Denk,
>
> Am 08.12.2010 um 23:52 schrieb Wolfgang Denk:
>
>> Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
>>
>> In message<1291099039-49672-4-git-send-email-andreas.devel@googlemail.com>  you wrote:
>>> Without this patch the linker will SEGFAULT on some undefined weak
>>> symbols.
>>>
>>> Suggested-by: Sebastien Carlier<sebastien.carlier@gmail.com>
>>> Signed-off-by: Andreas Bießmann<andreas.devel@googlemail.com>
>>> ---
>>> arch/arm/cpu/arm920t/u-boot.lds |    3 +++
>>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> Applied, thanks.
>
> Please do not apply that patch! I'm sorry I have split up the thread cause it lead to a generic timer discussion. Therefore I posted v2 of this patch series here:
> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/89974
>
> This patch is not needed, if no undefined weak symbol is available.
> This patch adds .plt/.rel.plt section which has R_ARM_JUMP_SLOT which is not handled in code. Therefore we do not really know what this patch does to the code, it was mostly a patch to handle the linker segfault described several times.

Thanks for pointing this out. My bad: I did not relate the two series 
when going through patchwork.

Wolfgang, I was about to send out a revert but after pulling u-boot.git 
and u-boot-arm.git I don't see Andreas' patch in there. If you haven't 
committed it yet, maybe you can fix this yourself?

> regards
>
> Andreas Bießmann

Amicalement,
Wolfgang Denk Dec. 9, 2010, 9:45 a.m. UTC | #4
Dear Albert ARIBAUD,

In message <4D008638.4060004@aribaud.net> you wrote:
>
> > This patch is not needed, if no undefined weak symbol is available.
> > This patch adds .plt/.rel.plt section which has R_ARM_JUMP_SLOT which is not handled in code. Therefore we do not really know what this patch does to the code, it was mostly a patch to handle the linker segfault described several times.
> 
> Thanks for pointing this out. My bad: I did not relate the two series 
> when going through patchwork.
> 
> Wolfgang, I was about to send out a revert but after pulling u-boot.git 
> and u-boot-arm.git I don't see Andreas' patch in there. If you haven't 
> committed it yet, maybe you can fix this yourself?

Hm... strange...

I am absolutely sure that I did apply these patches last night, and
then I even pushed them out... ... but now I see no trace of this
either.

Don't know what happened (I should learn this lesson - this is what I
get when _not_ having a beer ;-)

Ummm... now I have a problem, because I have marked all these patches
as "applied", both in patchwork and in my mail reader. This actually
means that I have completely lost track of what is missing and which
patches should be applied :-(

Best regards,

Wolfgang Denk
Wolfgang Denk Dec. 9, 2010, 10:32 a.m. UTC | #5
Dear Wolfgang Denk,

In message <20101209094538.7B9BBD08A93@gemini.denx.de> you wrote:
>
> Hm... strange...
> 
> I am absolutely sure that I did apply these patches last night, and
> then I even pushed them out... ... but now I see no trace of this
> either.
> 
> Don't know what happened (I should learn this lesson - this is what I
> get when _not_ having a beer ;-)
> 
> Ummm... now I have a problem, because I have marked all these patches
> as "applied", both in patchwork and in my mail reader. This actually
> means that I have completely lost track of what is missing and which
> patches should be applied :-(

OK, I found the stuff. I have applied to my working copy of the master
branch instesd of ARM.

So only the "-pie" commit needs to be removed?

Best regards,

Wolfgang Denk
Andreas Bießmann Dec. 9, 2010, 10:51 a.m. UTC | #6
Dear Wolfgang Denk,

Am 09.12.2010 11:32, schrieb Wolfgang Denk:
> Dear Wolfgang Denk,
> 
> In message <20101209094538.7B9BBD08A93@gemini.denx.de> you wrote:

> 
> OK, I found the stuff. I have applied to my working copy of the master
> branch instesd of ARM.
> 
> So only the "-pie" commit needs to be removed?

All of this series should not be applied. Two of them already upstream
in u-boot-arm/master.
Namely:
 - 0a41edaabb74f2ccfde62a232165088098763e3e MAKEALL: fix AT91
 - 3a4ff8b3cd719372cb3b3a8432e68015d84f1fc2 at91rm9200ek: add configure
target for RAM boot

One of them is modified already in upstream u-boot-arm/master:
 - a429db7e3ce6136f80f22584588247926ba60b05 arm920t/at91/timer: replace
bss variables by gd

And last one of them (-pie) is superseeded by another one also already
in u-boot-arm/master:
 - 305bf489d1e7dd70f45720720ae0066fcce3acb1
arm920t/at91/reset: board_reset: define weak symbol


BTW: All the mentioned hashes miss Signed-off of custodians. Is that
correct?

regards

Andreas Bießmann
diff mbox

Patch

diff --git a/arch/arm/cpu/arm920t/u-boot.lds b/arch/arm/cpu/arm920t/u-boot.lds
index a6f8b56..d8b77df 100644
--- a/arch/arm/cpu/arm920t/u-boot.lds
+++ b/arch/arm/cpu/arm920t/u-boot.lds
@@ -43,6 +43,9 @@  SECTIONS
 		*(.text)
 	}
 
+	.plt : { *(.plt) }
+	.rel.plt : { *(.rel.plt) }
+
 	. = ALIGN(4);
 	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }