• Shenghou Ma's avatar
    cmd/ld: don't include padding length in size of the note section · 37e195cf
    Shenghou Ma authored
    Recently NetBSD starts to enforce this, and refuses to execute
    the program if n is larger than the sum of entry sizes.
    
    Before:
    $ readelf -n ../bin/go.old
    Notes at offset 0x00000bd0 with length 0x00000019:
      Owner         Data size       Description
      NetBSD                0x00000004      NT_VERSION (version)
    readelf: Warning: corrupt note found at offset 18 into core notes
    readelf: Warning:  type: 0, namesize: 00000000, descsize: 00000000
    $ readelf -n ../bin/go
    Notes at offset 0x00000bd0 with length 0x00000018:
    Owner         Data size       Description
    NetBSD                0x00000004      NT_VERSION (version)
    
    LGTM=iant
    R=iant
    CC=golang-codereviews
    https://golang.org/cl/70710043
    37e195cf
Name
Last commit
Last update
..
data.c Loading commit data...
decodesym.c Loading commit data...
doc.go Loading commit data...
dwarf.c Loading commit data...
dwarf.h Loading commit data...
dwarf_defs.h Loading commit data...
elf.c Loading commit data...
elf.h Loading commit data...
go.c Loading commit data...
ldelf.c Loading commit data...
ldmacho.c Loading commit data...
ldpe.c Loading commit data...
lib.c Loading commit data...
lib.h Loading commit data...
macho.c Loading commit data...
macho.h Loading commit data...
pass.c Loading commit data...
pcln.c Loading commit data...
pe.c Loading commit data...
pe.h Loading commit data...
pobj.c Loading commit data...
symtab.c Loading commit data...
textflag.h Loading commit data...