From: Troy Kisky <troy.kisky@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] RFC: create u-boot-common.lds
Date: Tue, 07 Feb 2012 17:49:17 -0700 [thread overview]
Message-ID: <4F31C68D.5020400@boundarydevices.com> (raw)
In-Reply-To: <CALButC+xpVg32-teRhML4VDHPZq_E6xpHb+cRx44b9awQY2zmQ@mail.gmail.com>
On 2/7/2012 5:39 PM, Graeme Russ wrote:
> Hi Troy,
>
> On Wed, Feb 8, 2012 at 11:20 AM, Troy Kisky
> <troy.kisky@boundarydevices.com> wrote:
>> This makes adding linker defined tables easier
>> as only 1 lds file (include/u-boot-common.lds)
>> will need to be touched instead of 193 files.
>>
>> Signed-off-by: Troy Kisky<troy.kisky@boundarydevices.com>
>> ---
>
>> diff --git a/arch/arm/cpu/arm1136/u-boot.lds b/arch/arm/cpu/arm1136/u-boot.lds
>> index d1e2851..fe07097 100644
>> --- a/arch/arm/cpu/arm1136/u-boot.lds
>> +++ b/arch/arm/cpu/arm1136/u-boot.lds
>> @@ -52,12 +52,7 @@ SECTIONS
>> *(.data)
>> }
>>
>> - . = ALIGN(4);
>> -
>> - . = .;
>> - __u_boot_cmd_start = .;
>> - .u_boot_cmd : { *(.u_boot_cmd) }
>> - __u_boot_cmd_end = .;
>> +#include<u-boot-common.lds>
>>
>> . = ALIGN(4);
>>
> Ick! A #define in the middle of a file :(
>
> I would rather see the code block you are replacing #defined in
> include/u-boot-common.lds.h and then use the define at the desired
> location in the arch lds file. This will allow multiple 'functional
> linker blocks' to be defined that the acrch scripts can arrange as they
> see fit.
>
> Also, ALIGN(4) may not always be a given, so maybe we should pass that in
> as a parameter?
>
> Hmmm....maybe something like (most likely not syntactically correct):
>
> #define U_BOOT_LDS_SECTION(section, alignment) \
> . = ALIGN(alignment); \
> U_BOOT_LDS_SYMBOL(section ## _start) = .;
> . ## section : { KEEP(*(. ## section)) }
> U_BOOT_LDS_SYMBOL(section ## _end) = .;
>
>
> So we can simply, in the arch lds:
>
> U_BOOT_LDS_SECTION(text, 4)
> U_BOOT_LDS_SECTION(u_boot_cmd, 4)
> U_BOOT_LDS_SECTION(rodata, 4)
> U_BOOT_LDS_SECTION(data, 4)
> U_BOOT_LDS_SECTION(dynsym, 4)
>
> Regards,
>
> Graeme
>
That works fine for existing sections.. i.e
U_BOOT_LDS_SECTION(u_boot_cmd, 4)
but what about the next patch in the series?
Do you want me to change all lds files again?
I hope you have a better idea for how to handle patch 2/2.
Thanks for the feedback.
Troy
next prev parent reply other threads:[~2012-02-08 0:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 0:20 [U-Boot] [PATCH v2 1/2] RFC: create u-boot-common.lds Troy Kisky
2012-02-08 0:20 ` [U-Boot] [PATCH v2 2/2] RFC: Let linker create phy array Troy Kisky
2012-02-08 0:39 ` [U-Boot] [PATCH v2 1/2] RFC: create u-boot-common.lds Graeme Russ
2012-02-08 0:49 ` Troy Kisky [this message]
2012-02-08 1:21 ` Graeme Russ
2012-02-08 1:22 ` Graeme Russ
2012-02-08 1:24 ` Graeme Russ
2012-02-08 1:56 ` Troy Kisky
2012-02-08 2:24 ` Graeme Russ
2012-02-08 2:46 ` Troy Kisky
2012-02-08 2:51 ` Graeme Russ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F31C68D.5020400@boundarydevices.com \
--to=troy.kisky@boundarydevices.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.