• Gustavo Niemeyer's avatar
    ld: fix ELF strip by removing overlap of sections · cf143e9d
    Gustavo Niemeyer authored
    The gosymtab and gopclntab sections were pointing to the proper
    data, but that data was already owned by the rodata section.
    Some ELF references explicitly prohibit multiple sections from
    owning the same data, and strip behaves accordingly.
    
    The data for these sections was moved to after rodata, and the
    gosymtab and gopclntab sections now own their respective ranges.
    
    This change makes strip happy both with and without -s being
    provided at link time.  Note that it won't remove these sections
    because they are still allocated, and that's by design since
    they are necessary at runtime for generating proper backtraces
    and similar introspection operations.
    
    Unlike the previous behavior, -s will now maintain zero-sized
    gosymtab and gopclntab sections.  This makes the implementation
    slightly cleaner.
    
    Fixes #1242.
    
    NOTE: Tested on Linux amd64/386/arm only.
    
    R=ality, rsc
    CC=golang-dev
    https://golang.org/cl/4639077
    cf143e9d
Name
Last commit
Last update
..
6.out.h Loading commit data...
Makefile Loading commit data...
asm.c Loading commit data...
doc.go Loading commit data...
l.h Loading commit data...
list.c Loading commit data...
mkenam Loading commit data...
obj.c Loading commit data...
optab.c Loading commit data...
pass.c Loading commit data...
prof.c Loading commit data...
span.c Loading commit data...