]> Cypherpunks repositories - gostls13.git/commit
ld: fix and simplify ELF symbol generation
authorAnthony Martin <ality@pbrane.org>
Tue, 7 Jun 2011 18:26:16 +0000 (14:26 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 7 Jun 2011 18:26:16 +0000 (14:26 -0400)
commitc5030e5f4b5553b1deade2dd0107990d8449c16c
tree90233085440897c84e4d717f234205db89fcc2f7
parent35b74d69033b0fb51b464547aaedce234c0e6661
ld: fix and simplify ELF symbol generation

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
src/cmd/5l/asm.c
src/cmd/6l/asm.c
src/cmd/8l/asm.c
src/cmd/ld/lib.h
src/cmd/ld/symtab.c