]> Cypherpunks repositories - gostls13.git/commit
cmd/link: don't fail if multiple ELF sections have the same name
authorIan Lance Taylor <iant@golang.org>
Thu, 18 Apr 2019 05:41:51 +0000 (22:41 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 18 Apr 2019 15:07:12 +0000 (15:07 +0000)
commit3235f7c0720338a160debe6e9c632b8af968b4dd
treefcbf569f27d89f04b3aa8de18a8e90dff8b172cb
parentc226f6432d465ad9e2d21962353ba86834a2afcb
cmd/link: don't fail if multiple ELF sections have the same name

New versions of clang can generate multiple sections named ".text"
when using vague C++ linkage. This is valid ELF, but would cause the
Go linker to report an error when using internal linking:
    symbol PACKAGEPATH(.text) listed multiple times
Avoid the problem by renaming section symbol names if there is a name
collision.

Change-Id: I41127e95003d5b4554aaf849177b3fe000382c02
Reviewed-on: https://go-review.googlesource.com/c/go/+/172697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/elf_test.go [new file with mode: 0644]
src/cmd/link/internal/loadelf/ldelf.go