[fpc-pascal] Getting build ID

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Oct 24 15:37:40 CEST 2015


Andrew Haines wrote:
> On 10/22/2015 08:08 PM, Mark Morgan Lloyd wrote:
>> If a program is linked with GNU ld using the --build-id option, how 
>> can it retrieve the value at runtime?
> 
> I've never done it but maybe a place to start is use the elfreader unit 
> in fcl-res to open ParamStr(0) and read the data from the 
> .note.gnu.build-id section.

Thanks, I'll take a look. I'm looking for something that I can put as a 
"magic number" at the bottom of some shared memory, and the build-id is 
ideal since it can be set to a fixed value during debugging.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list