• 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
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...