Teach aelflod to write the ELF symbol table.
authorGeorge Koehler <xkernigh@netscape.net>
Tue, 13 Dec 2016 21:41:22 +0000 (16:41 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Tue, 13 Dec 2016 21:41:22 +0000 (16:41 -0500)
commit5cf2a684384c17880e63c478eff78d756b9041ca
tree2e59523fd76beadb4df32df19c611aaf6a77e629
parent8280ca8745af514236f3dd24b52f404bfe2bcf09
Teach aelflod to write the ELF symbol table.

Convert each ack.out symbol to ELF, preserving its name and value, and
some but not all other symbol info.  The ELF symbol table comes with
ELF section headers.  If the input file has no symbols (ack -Rled-s),
then the output file has no ELF section headers.

Append the symbol table and section headers to the ELF file.  Linux
ignores this appended info when it execs the file.  The info might
pollute the last page of the ELF segment, but Linux clears this
pollution.  Tools like nm and gdb can read the ELF symbol table.

I include code to translate debugger symbols to an ELF .stab section.
I did not test this code, because I did not find a platform that can
put S_STB symbols in the ack.out file.
util/amisc/aelflod.c