This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Storing the memory configuration used at link-time into a binary.


Hi Nick,

I see your point. We just thought that it could be helpful for embedded systems using the binutils.
Thank you for the time spent on it.


About your proposal to use a linker command line option instead of a linker script directive, it's something that we envisaged, but there were two reasons to favor the linker script:
- we are dealing with memory configuration that is also described inside the linker script
- we wanted to let the programmer decide if this information is located in a non-loadable or loadable section. In the first case, he can use it only on the host machine (inside a simulator for example that has acces to the ELF file). In the second case, he can use the information at runtime on the target, but impacting the memory footprint of the application.


Cheers,

PS: We have a similar feature under final development to create a table of section information, mainly to be used at runtime on a minimal embedded system, where the application has no access to ELF headers.
If the meminfo were accepted, we would have submitted this one too ;-)




From: *Nick Clifton* <nickc@redhat.com <mailto:nickc@redhat.com>>
Date: Mon, Mar 2, 2009 at 3:52 PM
Subject: Re: Storing the memory configuration used at link-time into a binary.
To: Denis FERRANTI <denis.ferranti@st.com <mailto:denis.ferranti@st.com>>
Cc: bu-sourceware <binutils@sourceware.org <mailto:binutils@sourceware.org>>



Hi Denis,




    Our co-workers at STMicroelectronics develop on many SoCs at a time
    which sometimes only differ from memory configurations, so they have
    [to take care] to use a compatible linker-script (among many).  That's
    why we introduced a new linker-script statement "CREATE_MEMINFO_TABLE"
    which stores the memory configuration used at link-time into a binary,
    then the embedded "meminfo" table can be used by loaders to make
    compatibility checks or by simulators for auto-configuration.


Thank you for telling us about this idea. I am not sure that there would be any need for it outside of your own application, so I do not really think that it is suitable for inclusion into the mainstream sources.


Also I would suggest that it might be better to control this feature via a linker command line option rather than a linker script directive. This would be more flexible because the name of the meminfo table file could be specified on the command line, rather than being fixed by the linker script.

Cheers
 Nick
--
Denis Ferranti


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]