Acontece que dizer ao linker para emular o elf_i386 produziu a saída que eu estava procurando, embora eu não entenda o porquê. Ou seja, invoque o vinculador com:
$ ld -melf_i386 [...]
Os arquivos produzidos com e sem -melf_i386
parecem ser basicamente semelhantes:
with.elf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped, with debug_info
without.elf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped, with debug_info
Exceto que seus tamanhos são muito diferentes:
$ ls -l *.elf
-rwxr-xr-x 1 user user 10948 May 24 11:56 with.elf
-rwxr-xr-x 1 user user 1055428 May 24 11:56 without.elf
Tanto quanto eu posso dizer, os arquivos de saída são exatamente iguais:
$ readelf -S with.elf
There are 12 section headers, starting at offset 0x28e4:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 00100000 001000 000205 00 AX 0 0 4
[ 2] .eh_frame PROGBITS 00100208 001208 0000b8 00 A 0 0 4
[ 3] .bss NOBITS 001002c0 0012c0 3ef000 00 WA 0 0 4
[ 4] .debug_info PROGBITS 00000000 0012c0 0007bf 00 0 0 1
[ 5] .debug_abbrev PROGBITS 00000000 001a7f 0002c9 00 0 0 1
[ 6] .debug_aranges PROGBITS 00000000 001d48 000060 00 0 0 1
[ 7] .debug_line PROGBITS 00000000 001da8 00023c 00 0 0 1
[ 8] .debug_str PROGBITS 00000000 001fe4 0004bd 01 MS 0 0 1
[ 9] .symtab SYMTAB 00000000 0024a4 000280 10 10 22 4
[10] .strtab STRTAB 00000000 002724 00014e 00 0 0 1
[11] .shstrtab STRTAB 00000000 002872 000070 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
p (processor specific)
Note que o campo "offset" é ligeiramente diferente
$ readelf -S without.elf
There are 12 section headers, starting at offset 0x1018e4:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 00100000 100000 000205 00 AX 0 0 4
[ 2] .eh_frame PROGBITS 00100208 100208 0000b8 00 A 0 0 4
[ 3] .bss NOBITS 001002c0 1002c0 3ef000 00 WA 0 0 4
[ 4] .debug_info PROGBITS 00000000 1002c0 0007bf 00 0 0 1
[ 5] .debug_abbrev PROGBITS 00000000 100a7f 0002c9 00 0 0 1
[ 6] .debug_aranges PROGBITS 00000000 100d48 000060 00 0 0 1
[ 7] .debug_line PROGBITS 00000000 100da8 00023c 00 0 0 1
[ 8] .debug_str PROGBITS 00000000 100fe4 0004bd 01 MS 0 0 1
[ 9] .symtab SYMTAB 00000000 1014a4 000280 10 10 22 4
[10] .strtab STRTAB 00000000 101724 00014e 00 0 0 1
[11] .shstrtab STRTAB 00000000 101872 000070 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
p (processor specific)