• Gustavo Niemeyer's avatar
    ld: remove overlap of ELF sections on dynamic binaries · ba2e3af1
    Gustavo Niemeyer authored
    The dynamic ELF sections were pointing to the proper data,
    but that data was already owned by the rodata and text sections.
    Some ELF references explicitly prohibit multiple sections from
    owning the same data, and strip behaves accordingly.
    
    The data for these sections was moved out and their ranges are
    now owned by their respective sections.  This change makes strip
    happy both with and without -s being provided at link time.
    
    A test was added in debug/elf to ensure there are no regressions
    on this area in the future.
    
    Fixes #1242.
    Fixes #2022.
    
    NOTE: Tested on Linux amd64/386/arm only.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4808043
    ba2e3af1
pe.c 13.1 KB