summaryrefslogtreecommitdiff
path: root/src/cmd/ld
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2014-10-20 23:28:39 +0000
committerDave Cheney <dave@cheney.net>2014-10-20 23:28:39 +0000
commit2d4e74c499551f930b0144a85f0d6e239782e3ca (patch)
treeb16483a5dd781b180b64fb4122e43050a1622938 /src/cmd/ld
parent27a521f0744ec4be238adff5d2383d6a9ec4b3a1 (diff)
downloadgo-2d4e74c499551f930b0144a85f0d6e239782e3ca.tar.gz
cmd/cgo: disable clang's integrated assembler
Fixes issue 8348. Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used). This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim. This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/156430044
Diffstat (limited to 'src/cmd/ld')
-rw-r--r--src/cmd/ld/ldelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
index 35f8b4985..b5d081949 100644
--- a/src/cmd/ld/ldelf.c
+++ b/src/cmd/ld/ldelf.c
@@ -819,7 +819,7 @@ readsym(ElfObj *obj, int i, ElfSym *sym, int needSym)
}
break;
case ElfSymBindLocal:
- if(!(thechar == '5' && (strcmp(sym->name, "$a") == 0 || strcmp(sym->name, "$d") == 0))) // binutils for arm generate these mapping symbols, ignore these
+ if(!(thechar == '5' && (strncmp(sym->name, "$a", 2) == 0 || strncmp(sym->name, "$d", 2) == 0))) // binutils for arm generate these mapping symbols, ignore these
if(needSym) {
// local names and hidden visiblity global names are unique
// and should only reference by its index, not name, so we