]> Cypherpunks repositories - gostls13.git/commit
ld: remove overlap of ELF sections on dynamic binaries
authorGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 20 Jul 2011 15:47:02 +0000 (12:47 -0300)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 20 Jul 2011 15:47:02 +0000 (12:47 -0300)
commitba2e3af1778da52340a9f3f7dd7262e5ebf64055
tree042764904ef3de91ac6038ae8622ffdffedeb748
parent971459e826e705fc7c0ce4cd65609a19876627b1
ld: remove overlap of ELF sections on dynamic binaries

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
src/cmd/5l/asm.c
src/cmd/5l/span.c
src/cmd/6l/asm.c
src/cmd/8l/asm.c
src/cmd/ld/data.c
src/cmd/ld/elf.c
src/cmd/ld/lib.h
src/cmd/ld/pe.c
src/pkg/debug/elf/file_test.go