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

Issue 125140043: code review 125140043: liblink: use pc-relative addressing for all memory refe... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rsc
Modified:
10 years, 8 months ago
Reviewers:
aram, gobot, dave, iant, rminnich
CC:
golang-codereviews, rminnich, iant, r, minux
Visibility:
Public.

Description

liblink: use pc-relative addressing for all memory references in amd64 code

Patch Set 1 #

Patch Set 2 : diff -r 98a99580510924830669129217de838520223bb6 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 88a093108a9d774937ff8af61006f87ce20b0651 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 88a093108a9d774937ff8af61006f87ce20b0651 https://code.google.com/p/go/ #

Patch Set 5 : diff -r 88a093108a9d774937ff8af61006f87ce20b0651 https://code.google.com/p/go/ #

Patch Set 6 : diff -r 01dbe00c72b589ebfdff305b2024752aeed2a1ae https://code.google.com/p/go/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -28 lines) Patch
M src/cmd/6l/asm.c View 1 2 4 chunks +13 lines, -4 lines 0 comments Download
M src/cmd/ld/data.c View 1 2 1 chunk +7 lines, -3 lines 0 comments Download
M src/liblink/asm6.c View 1 4 chunks +8 lines, -21 lines 1 comment Download

Messages

Total messages: 13
rsc
Hello golang-codereviews@googlegroups.com (cc: iant, r, rminnich), I'd like you to review this change to https://code.google.com/p/go/
10 years, 9 months ago (2014-08-13 15:21:34 UTC) #1
rsc
After this change, I can build an ELF hello world linked at a large address ...
10 years, 9 months ago (2014-08-13 15:25:21 UTC) #2
rminnich
This did the trick, my tests work as well. LGTM
10 years, 9 months ago (2014-08-13 15:48:42 UTC) #3
iant
LGTM Probably should be mentioned in doc/go1.4.txt.
10 years, 9 months ago (2014-08-13 17:46:13 UTC) #4
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=3910cbf15646 *** liblink: use pc-relative addressing for all memory references in amd64 ...
10 years, 8 months ago (2014-08-19 01:07:01 UTC) #5
dave_cheney.net
On 2014/08/19 01:07:01, rsc wrote: > *** Submitted as https://code.google.com/p/go/source/detail?r=3910cbf15646 *** > > liblink: use ...
10 years, 8 months ago (2014-08-19 01:27:46 UTC) #6
rsc
the generic fix is to MOVQ $whatever into a register and then use that register ...
10 years, 8 months ago (2014-08-19 01:33:04 UTC) #7
gobot
This CL appears to have broken the windows-amd64 builder. See http://build.golang.org/log/16f128df0aa6475536cb40f8d3a3a0f5868c7e93
10 years, 8 months ago (2014-08-19 01:55:56 UTC) #8
rsc
I submitted a fix for the Windows breakage. I don't know what's wrong with Solaris. ...
10 years, 8 months ago (2014-08-19 02:14:27 UTC) #9
dave_cheney.net
Thanks, we'll get it fixed. On Tue, Aug 19, 2014 at 12:14 PM, Russ Cox ...
10 years, 8 months ago (2014-08-19 02:15:50 UTC) #10
aram
I'm still in vacation until September 1st or so; I don't think I can fix ...
10 years, 8 months ago (2014-08-19 10:30:48 UTC) #11
aram
https://codereview.appspot.com/125140043/diff/100001/src/liblink/asm6.c File src/liblink/asm6.c (right): https://codereview.appspot.com/125140043/diff/100001/src/liblink/asm6.c#newcode2290 src/liblink/asm6.c:2290: r->type = R_PCREL; I've taken another look at Solaris ...
10 years, 8 months ago (2014-08-20 17:53:34 UTC) #12
rsc
10 years, 8 months ago (2014-08-24 03:57:15 UTC) #13
Message was sent while issue was closed.
On 2014/08/20 17:53:34, aram wrote:
> https://codereview.appspot.com/125140043/diff/100001/src/liblink/asm6.c
> File src/liblink/asm6.c (right):
> 
>
https://codereview.appspot.com/125140043/diff/100001/src/liblink/asm6.c#newco...
> src/liblink/asm6.c:2290: r->type = R_PCREL;
> I've taken another look at Solaris today. The problem is that we don't want to
> do this (R_PCREL) when the symbol is a dynamic symbol (i.e. external symbols
> from libc.so, not external symbols in our own object files). We should be
still
> doing R_ADDR. This works fine (at least with the internal linker) because we
use
> the GOT to find these symbols, which preserves the position-independent
> property. See go/src/cmd/6l/asm.c:/^adddynrel.
> 
> Unfortunately, I have no idea how to differentiate dynamic symbols from our
own
> usual external symbols in liblink. In particular, most LSym fields are not
> initialized (they are initialized in the linker proper). In particular type,
> cgoexport, dynid, dynimplib seem to be uninitialized:
> 
>   name=libc.sysconf, extname=libc.sysconf, type=0, external=0, cgoexport=0,
> dynid=-1, dynimplib=<nil>
>   name=libc.sysconf, extname=libc.sysconf, type=0, external=0, cgoexport=0,
> dynid=-1, dynimplib=<nil>
> 
> So, any tips on how to make this distinction?

I sent you CL 129540043.
Sign in to reply to this message.

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