diff mbox

[U-Boot,07/33] x86: Ensure that all relocation data is included in the image

Message ID 1415751501-23407-8-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Nov. 12, 2014, 12:17 a.m. UTC
Some toolchains put the relocation data into separate sections. Adjust the
linker script to catch this case. Without relocation data, U-Boot will not
boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/cpu/u-boot.lds | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Bin Meng Nov. 12, 2014, 5:21 a.m. UTC | #1
On Wed, Nov 12, 2014 at 8:17 AM, Simon Glass <sjg@chromium.org> wrote:
> Some toolchains put the relocation data into separate sections. Adjust the
> linker script to catch this case. Without relocation data, U-Boot will not
> boot.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/cpu/u-boot.lds | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
> index f48bff5..95ab7dd 100644
> --- a/arch/x86/cpu/u-boot.lds
> +++ b/arch/x86/cpu/u-boot.lds
> @@ -44,7 +44,9 @@ SECTIONS
>
>         . = ALIGN(4);
>         __rel_dyn_start = .;
> -       .rel.dyn : { *(.rel.dyn) }
> +       .rel.dyn : {
> +               *(.rel.*)

Should it be more generic to use *(.rel*) here?

> +       }
>         __rel_dyn_end = .;
>         . = ALIGN(4);
>         _end = .;
> --

Regards,
Bin
Simon Glass Nov. 12, 2014, 5:28 a.m. UTC | #2
Hi Bin,

On 11 November 2014 22:21, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Wed, Nov 12, 2014 at 8:17 AM, Simon Glass <sjg@chromium.org> wrote:
>> Some toolchains put the relocation data into separate sections. Adjust the
>> linker script to catch this case. Without relocation data, U-Boot will not
>> boot.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  arch/x86/cpu/u-boot.lds | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
>> index f48bff5..95ab7dd 100644
>> --- a/arch/x86/cpu/u-boot.lds
>> +++ b/arch/x86/cpu/u-boot.lds
>> @@ -44,7 +44,9 @@ SECTIONS
>>
>>         . = ALIGN(4);
>>         __rel_dyn_start = .;
>> -       .rel.dyn : { *(.rel.dyn) }
>> +       .rel.dyn : {
>> +               *(.rel.*)
>
> Should it be more generic to use *(.rel*) here?

I suspect that would be safe, but why?

>
>> +       }
>>         __rel_dyn_end = .;
>>         . = ALIGN(4);
>>         _end = .;
>> --

Regards,
Simon
Bin Meng Nov. 12, 2014, 5:32 a.m. UTC | #3
Hi Simon,

On Wed, Nov 12, 2014 at 1:28 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 11 November 2014 22:21, Bin Meng <bmeng.cn@gmail.com> wrote:
>> On Wed, Nov 12, 2014 at 8:17 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Some toolchains put the relocation data into separate sections. Adjust the
>>> linker script to catch this case. Without relocation data, U-Boot will not
>>> boot.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>  arch/x86/cpu/u-boot.lds | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
>>> index f48bff5..95ab7dd 100644
>>> --- a/arch/x86/cpu/u-boot.lds
>>> +++ b/arch/x86/cpu/u-boot.lds
>>> @@ -44,7 +44,9 @@ SECTIONS
>>>
>>>         . = ALIGN(4);
>>>         __rel_dyn_start = .;
>>> -       .rel.dyn : { *(.rel.dyn) }
>>> +       .rel.dyn : {
>>> +               *(.rel.*)
>>
>> Should it be more generic to use *(.rel*) here?
>
> I suspect that would be safe, but why?

Just in case some weird toolchain omit the "." afer "rel". Which
toolchain are you using now that exposes such behavior?

>>
>>> +       }
>>>         __rel_dyn_end = .;
>>>         . = ALIGN(4);
>>>         _end = .;
>>> --
>
> Regards,
> Simon

Regards,
Bin
diff mbox

Patch

diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index f48bff5..95ab7dd 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -44,7 +44,9 @@  SECTIONS
 
 	. = ALIGN(4);
 	__rel_dyn_start = .;
-	.rel.dyn : { *(.rel.dyn) }
+	.rel.dyn : {
+		*(.rel.*)
+	}
 	__rel_dyn_end = .;
 	. = ALIGN(4);
 	_end = .;