From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: How can I get this data into the .data section of the binary?
Date: Wed, 17 Jun 2020 17:01:25 +0300 [thread overview]
Message-ID: <hkum1lFejfoU1@mid.individual.net> (raw)
In-Reply-To: <rcd2qt$1317$1@gioia.aioe.org>
On 2020-06-17 15:37, Luke A. Guest wrote:
> On 16/06/2020 19:19, Tero Koskinen wrote:
>> Hi,
>>
>> I haven't tried with your example, but is GNAT specific pragma
>> Linker_Section acceptable?
>
> I can't really see how it would be as it would still require the
> compiler to actually generate the correct value in .data or .rodata
> space rather than a 0x0 which gets filled in later by elaboration.
>
> Interesting though.
>
> I wrote the above before trying. Trying to place it in ".rodata..."
> caused a compiler error, placing it in .data worked, but there is still
> elaboration code.
The compiler error probably resulted from the compiler generating
elaboration code to write something into the read-only ".rodata", right?
I once tried to put a static constant (a program-version string) into
".rodata" with pragma Linker_Section, and had no success -- it seemed to
me that (the version I had of) the GNU linker was doing some magic with
".rodata" that was not expressed in the linker command script.
I changed to use another section name (something of my own invention,
perhaps ".version" or whatever) and it worked right away. Of course I
also had to update the linker command script to place that section
somewhere.
(My object in that case was just a static string, so GNAT produced no
elaboration code, so no help for the original problem.)
--
Niklas Holsti
niklas holsti tidorum fi
. @ .
next prev parent reply other threads:[~2020-06-17 14:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 11:31 How can I get this data into the .data section of the binary? Luke A. Guest
2020-06-16 11:37 ` Luke A. Guest
2020-06-16 11:50 ` J-P. Rosen
2020-06-16 12:36 ` Luke A. Guest
2020-06-16 12:45 ` Luke A. Guest
2020-06-16 12:56 ` J-P. Rosen
2020-06-16 12:59 ` Luke A. Guest
2020-06-16 13:29 ` J-P. Rosen
2020-06-16 13:44 ` Luke A. Guest
2020-06-18 2:55 ` Randy Brukardt
2020-06-18 9:55 ` Niklas Holsti
2020-06-21 3:55 ` Randy Brukardt
2020-06-21 6:55 ` Niklas Holsti
2020-06-16 13:52 ` Mark Lorenzen
2020-06-16 14:08 ` Luke A. Guest
2020-06-16 13:03 ` Luke A. Guest
2020-06-16 14:14 ` Niklas Holsti
2020-06-16 14:25 ` Dmitry A. Kazakov
2020-06-16 14:32 ` Niklas Holsti
2020-06-16 14:42 ` Luke A. Guest
2020-06-16 15:21 ` Dmitry A. Kazakov
2020-06-16 15:43 ` Luke A. Guest
2020-06-16 16:11 ` Dmitry A. Kazakov
2020-06-16 14:40 ` Luke A. Guest
2020-06-16 18:19 ` Tero Koskinen
2020-06-17 12:37 ` Luke A. Guest
2020-06-17 14:01 ` Niklas Holsti [this message]
2020-06-17 15:17 ` Luke A. Guest
2020-09-03 10:32 ` c+
2020-09-13 13:36 ` patelchetan1111992
2020-09-19 14:08 ` erchetan33
2020-09-28 11:36 ` yhumina stir
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox