• Anthony Martin's avatar
    ld: fix and simplify ELF symbol generation · c5030e5f
    Anthony Martin authored
    I started looking at this code because the nm in GNU
    binutils was ignoring the first symbol in the .symtab
    section.  Apparently, the System V ABI reserves the
    first entry and requires all fields inside to be set
    to zero.
    
    The list of changes is as follows:
    
      · reserve the first symbol entry (as noted above)
      · fix the section indices for .data and .bss symbols
      · factor out common code for Elf32 and Elf64
      · remove the special case for elfsymo in [568]l/asm.c:/^asmb
      · add the "etext" symbol in 6l
      · add static symbols
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4524075
    c5030e5f
asm.c 29.5 KB