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

Issue 7629043: code review 7629043: cmd/ld: external linking fixes for linux/386 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by rsc
Modified:
12 years, 2 months ago
Reviewers:
CC:
golang-dev, iant
Visibility:
Public.

Description

cmd/ld: external linking fixes for linux/386 The sticking point on 386 has been the "PC relative" relocations used to point the garbage collection metadata at the type info. These aren't in the code segment, and I don't trust that the linker isn't doing something special that would be okay in code but not when interpreting the pointers as data (for example, a PLT jump table would be terrible). Solve the problem in two steps: 1. Handle "PC relative" relocations within a section internally, so that the external linker never sees them. 2. Move the gcdata and gcbss tables into the rodata section, where the type information lives, so that the relocations can be handled internally. (To answer the obvious question, we make the gc->type references relative so that they need not be relocated individually when generating a shared object file.)

Patch Set 1 #

Patch Set 2 : diff -r 451d31faf61c https://go.googlecode.com/hg #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -55 lines) Patch
M src/cmd/ld/data.c View 1 7 chunks +17 lines, -46 lines 0 comments Download
M src/cmd/ld/elf.c View 1 1 chunk +3 lines, -1 line 0 comments Download
M src/cmd/ld/lib.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/cmd/ld/lib.c View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/cmd/ld/symtab.c View 1 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg
12 years, 3 months ago (2013-03-08 06:28:33 UTC) #1
rsc
+iant
12 years, 3 months ago (2013-03-08 18:48:33 UTC) #2
iant
PLT table construction is controlled by the type of the symbol. You can get a ...
12 years, 3 months ago (2013-03-08 22:44:45 UTC) #3
iant
LGTM
12 years, 3 months ago (2013-03-08 22:48:12 UTC) #4
rsc
12 years, 3 months ago (2013-03-09 04:22:41 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=01c40d533367 ***

cmd/ld: external linking fixes for linux/386

The sticking point on 386 has been the "PC relative" relocations
used to point the garbage collection metadata at the type info.
These aren't in the code segment, and I don't trust that the linker
isn't doing something special that would be okay in code but
not when interpreting the pointers as data (for example, a PLT
jump table would be terrible).

Solve the problem in two steps:

1. Handle "PC relative" relocations within a section internally,
so that the external linker never sees them.

2. Move the gcdata and gcbss tables into the rodata section,
where the type information lives, so that the relocations can
be handled internally.

(To answer the obvious question, we make the gc->type
references relative so that they need not be relocated
individually when generating a shared object file.)

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7629043
Sign in to reply to this message.

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