.../src/cmd/8a/asm.c, around line #900:
/* This null SHdr must appear before all others */
sh = newElfShdr(elfstr[ElfStrEmpty]);
My guess is that this needs to be followed by an instruction to write
out the header, which in fact does not take place.
I will not be able to test this until a number of other
inconsistencies have been addressed, so if anyone knows whether this
code could in fact be dropped, I'd appreciate not having to figure it
out myself.
The full diffs to asm.c look like this:
308c308
< archreloc(Reloc *r, Sym *s, vlong *val)
---
> archreloc(Reloc *r, Sym *, vlong *val)
647c647
< uint32 va, fo, w, symo, startva, machlink;
---
> uint32 symo, startva, machlink;
779d778
< lputl(0); /* x */
895d893
< fo = HEADR;
897,901d894
< va = startva + fo;
< w = segtext.filelen;
<
< /* This null SHdr must appear before all others */
< sh = newElfShdr(elfstr[ElfStrEmpty]);
1217c1210
< Bprint(&bso, "symsize = %ud\n", symsize);
---
> Bprint(&bso, "symsize = %uld\n", symsize);
Comments are welcome. And, no, I don't plan to publish each set of
changes, I just would like anyone who cares to know that I'm embarking
on this and to make as many suggestions as they deem necessary.
++L