This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Generating an ELF file with PT_NOTE before PT_LOAD
- From: Andreas Schwab <schwab at suse dot de>
- To: Mike Crowe <mac at mcrowe dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 21 Feb 2018 16:58:39 +0100
- Subject: Re: Generating an ELF file with PT_NOTE before PT_LOAD
- Authentication-results: sourceware.org; auth=none
- References: <20180221144420.hidf5hbkvvxtwjje@mcrowe.com>
On Feb 21 2018, Mike Crowe <mac@mcrowe.com> wrote:
> --8<--
> #!/bin/sh
> set -e
> dd if=/dev/zero of=binary bs=1M count=1
> objcopy -I binary -O elf32-i386 -B i386 binary text.o
>
> gcc -c -m32 -x assembler - -o note.o <<EOF
> .section ".note.my-version", ""
I think you need to make that section allocated, otherwise the linker
will always place it after the other allocated sections.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."