]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/objabi: expand -trimpath syntax
authorRuss Cox <rsc@golang.org>
Tue, 23 Apr 2019 03:48:51 +0000 (23:48 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 24 Apr 2019 12:01:30 +0000 (12:01 +0000)
commit4891a3b66c482b42fdc74ae382e0cf4817d0fda2
tree4717ceee303f74b71aeac4cb55c997ea3de4c16d
parent97dfbc54e675b7ec94bfdb3bed453ffa938b77d5
cmd/internal/objabi: expand -trimpath syntax

This CL affects the low-level -trimpath flag provided
by both cmd/asm and cmd/compile. Previously, the flag
took the name of a single directory that would be trimmed
from recorded paths in the resulting object file.
This CL makes the flag take a semicolon-separated list of paths.
Further, each path can now end in an optional "=>replacement"
to specify what to replace that leading path prefix with,
instead of only dropping it.

A followup CL will add a mode to cmd/go that uses this
richer -trimpath to build binaries that do not contain any
local path names.

For #16860.

Change-Id: I246811750f37607c7f7a8fbecd56c5475ebe1ea5
Reviewed-on: https://go-review.googlesource.com/c/go/+/173344
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/internal/objabi/line.go
src/cmd/internal/objabi/line_test.go [new file with mode: 0644]