From: Tristan Gingold <gingold@adacore.com>
To: Catherine Moore <clm@codesourcery.com>
Cc: binutils@sourceware.org
Subject: Re: Comments requested for proposed for ld scripting language extension
Date: Fri, 29 Apr 2011 07:35:00 -0000 [thread overview]
Message-ID: <0AE7F26B-5214-479E-8B71-68CDE3A31511@adacore.com> (raw)
In-Reply-To: <4DB99A38.1010801@codesourcery.com>
On Apr 28, 2011, at 6:47 PM, Catherine Moore wrote:
[...]
> What I would like to do is add an extension to the scripting language. Something like this:
>
> MEMORY
> {
> ram (rwx) : ORIGIN = 0x100000, LENGTH = 144M
> }
>
> SECTIONS
> {
> .text : WITHOUT_FLAGS (SHF_PPC_VLE)
> {
> *(.text .text.* .gnu.linkonce.t.*)
> } >ram
> .text_vle : WITH_FLAGS (SHF_PPC_VLE)
> {
> *(.text .text.* .gnu.linkonce.t.*)
> } >ram
> }
>
> map_input_to_output_sections would then walk the input sections for those sections with an optional "FLAG" marker. A callback would be introduced that would examine the ELF header flags for the input sections and gather only those that met the criteria.
>
> I realize that this is an ELF-centric proposal. Although it could be extended to include other object formats, I haven't given that aspect alot of thought.
>
> Before I spend time on development, I'd like to solicit comments ahead of time. How do the maintainers and others feel about this plan?
I had similar thoughts but for the VMS format, where the section names are less important than their flags.
I think your proposal isn't that ELF-centric: the flags could be a mix of bfd ones (either from section or from file) and target
specific ones.
I also think that you could make the design a little bit generic and allow boolean negation. What about something like:
.text : FLAGS (-SHF_PPC_VLE)
{
*(.text .text.* .gnu.linkonce.t.*)
} >ram
.text_vle : FLAGS (+SHF_PPC_VLE)
{
*(.text .text.* .gnu.linkonce.t.*)
} >ram
That would make the life easier if we later want to add boolean operators (and, or).
Finally I wonder if the flags shouldn't be in the input section part, in order to make this feature even more generic:
.text :
{
*(.text .text.* .gnu.linkonce.t.*) FLAGS (-SHF_PPC_VLE)
} >ram
Tristan.
next prev parent reply other threads:[~2011-04-29 7:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 16:48 Catherine Moore
2011-04-29 0:24 ` Alan Modra
2011-04-29 7:35 ` Tristan Gingold [this message]
2011-05-03 8:44 ` Richard Sandiford
2011-05-03 8:52 ` Tristan Gingold
2011-05-03 14:35 ` Catherine Moore
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=0AE7F26B-5214-479E-8B71-68CDE3A31511@adacore.com \
--to=gingold@adacore.com \
--cc=binutils@sourceware.org \
--cc=clm@codesourcery.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).