public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* embed memory region information into an elf file
@ 2020-03-31 21:04 Massimiliano Cialdi
  2020-04-01 13:33 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Massimiliano Cialdi @ 2020-03-31 21:04 UTC (permalink / raw)
  To: binutils

The context where I'm surfing is bare-metal, and gcc/binutils toolchain

Is there any magic argument of ld, or some plugin, that allows to
embed the information of memory regions (usually present in the linker
script) into the elf file?

This way I could get the information I need (name, base address and
size) directly from the elf, and I would no longer need to have the
linker script (and parse it).

best regards
Max

-- 
Et nunc, auxilium solis, vincam!
Oppugnatio solaris!
VIS!

Massimiliano Cialdi
cialdi@gmail.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: embed memory region information into an elf file
  2020-03-31 21:04 embed memory region information into an elf file Massimiliano Cialdi
@ 2020-04-01 13:33 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2020-04-01 13:33 UTC (permalink / raw)
  To: Massimiliano Cialdi, binutils

Hi Massimiliano,

> Is there any magic argument of ld, or some plugin, that allows to
> embed the information of memory regions (usually present in the linker
> script) into the elf file?

In short: "no". :-(

> This way I could get the information I need (name, base address and
> size) directly from the elf, and I would no longer need to have the
> linker script (and parse it).

But you can add extra data into ELF files.  For example objcopy has an
--add-section option which could be used to insert a section containing
the required data.  (You would have to decide on the format of the data
and create a file containing the necessary information, but this should
not be too hard).

Cheers
  Nick



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-01 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 21:04 embed memory region information into an elf file Massimiliano Cialdi
2020-04-01 13:33 ` Nick Clifton

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).