Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(391)

Issue 4639077: code review 4639077: ld: fix ELF strip by removing overlap of sections (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 6 months ago by niemeyer
Modified:
13 years, 6 months ago
Reviewers:
gustavo, zhai
CC:
ality, rsc, golang-dev
Visibility:
Public.

Description

ld: fix ELF strip by removing overlap of sections 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 issue 1242. NOTE: Tested on Linux amd64/386/arm only.

Patch Set 1 #

Patch Set 2 : code review 4639077: ld: fix strip by removing overlap of sections #

Patch Set 3 : diff -r d4c5ffc402ba https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r d4c5ffc402ba https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r dde611a6760e https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -78 lines) Patch
M src/cmd/5l/asm.c View 1 2 4 chunks +8 lines, -23 lines 0 comments Download
M src/cmd/6l/asm.c View 1 2 4 chunks +7 lines, -22 lines 0 comments Download
M src/cmd/8l/asm.c View 1 2 4 chunks +7 lines, -22 lines 0 comments Download
M src/cmd/ld/data.c View 1 2 4 chunks +30 lines, -9 lines 0 comments Download
M src/cmd/ld/lib.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/ld/lib.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/ld/symtab.c View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8
niemeyer
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 6 months ago (2011-06-28 00:15:51 UTC) #1
ality
n13m3y3r@gmail.com once said: > Unlike the previous behavior, -s will now maintain zero-sized > gosymtab ...
13 years, 6 months ago (2011-06-28 01:31:46 UTC) #2
rsc
LGTM In CL description, s/Fixes/Fixes issue/
13 years, 6 months ago (2011-06-28 02:35:37 UTC) #3
niemeyer
*** Submitted as http://code.google.com/p/go/source/detail?r=2efa68a4183d *** ld: fix ELF strip by removing overlap of sections The ...
13 years, 6 months ago (2011-06-28 21:28:35 UTC) #4
niemeyer
> Does the spec allow a NOBITS section to be inside a > segment set ...
13 years, 6 months ago (2011-06-28 21:29:44 UTC) #5
zhai
There are still some overlapped sections in binary file "goinstall" and "godoc" GOARCH=386 godoc: .rodata ...
13 years, 6 months ago (2011-06-29 02:21:32 UTC) #6
gustavo_niemeyer.net
> There are still some overlapped sections in binary file "goinstall" and > "godoc" Can ...
13 years, 6 months ago (2011-06-29 08:20:27 UTC) #7
zhai
13 years, 6 months ago (2011-06-29 08:59:18 UTC) #8
Done,
new issue 2022
http://code.google.com/p/go/issues/detail?id=2022&colspec=ID%20Status%20Stars...

On Wed, Jun 29, 2011 at 4:20 PM, Gustavo Niemeyer <gustavo@niemeyer.net>wrote:

> > There are still some overlapped sections in binary file "goinstall" and
> > "godoc"
>
> Can you please open another bug about this?  A similar fix has to be
> applied to dynamic binaries.
>
> I'll work on that next.
>
> --
> Gustavo Niemeyer
> http://niemeyer.net
> http://niemeyer.net/blog
> http://niemeyer.net/twitter
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b