aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2011-06-22 15:12:22 -0400
committerRuss Cox <rsc@golang.org>2011-06-22 15:12:22 -0400
commit89d334ffe1fe7667505033f4ca49ff50954d9e7e (patch)
tree5a66c278f5453da53986908cf7c6d426250e7274
parent5dfdccf2b0d499881b9453eb4a1e8b91a3f1e706 (diff)
downloadgo-89d334ffe1fe7667505033f4ca49ff50954d9e7e.tar.gz
go-89d334ffe1fe7667505033f4ca49ff50954d9e7e.zip
ld: don't attempt to build dynamic sections unnecessarily
This prevents ld from generating zeroed symtab entries for sections that aren't going to be generated because dynamic linkage has been disabled (-d was used or no dynamic libs were seen). Even though they were not explicitly added by doelf, the section creation process was making them reachable again. The windows head is being disconsidered for this because apparently it's not taking into account debug['d']. This makes elflint 0.1% happier. R=golang-dev, rsc, gustavo CC=golang-dev https://golang.org/cl/4638050
-rw-r--r--src/cmd/ld/data.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index 9d9cd109b8..bdad58ff9a 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -278,6 +278,10 @@ dynreloc(void)
{
Sym *s;
+ // -d supresses dynamic loader format, so we may as well not
+ // compute these sections or mark their symbols as reachable.
+ if(debug['d'] && HEADTYPE != Hwindows)
+ return;
if(debug['v'])
Bprint(&bso, "%5.2f reloc\n", cputime());
Bflush(&bso);