]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: mark PIE binaries as ET_DYN
authorDavid Crawshaw <crawshaw@golang.org>
Tue, 6 Sep 2016 12:05:19 +0000 (08:05 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Sun, 11 Sep 2016 21:30:09 +0000 (21:30 +0000)
Part of adding PIE internal linking on linux/amd64.

Change-Id: I586e7c2afba349281168df5e20d2fdcb697f6e37
Reviewed-on: https://go-review.googlesource.com/28542
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/elf.go

index 3e027c6a08af1f2d86fc1d3d7d06f4c7cbc328f7..85935b67f92bc759c83de474e0f4f82e66084a82 100644 (file)
@@ -2589,6 +2589,8 @@ elfobj:
 
        if Linkmode == LinkExternal {
                eh.type_ = ET_REL
+       } else if Buildmode == BuildmodePIE {
+               eh.type_ = ET_DYN
        } else {
                eh.type_ = ET_EXEC
        }