[go] cmd/link: bring back R_ARM_V4BX for Annapurna AL-212 and possibly others

25 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Mar 14, 2021, 1:40:48 PM3/14/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

cmd/link: bring back R_ARM_V4BX for Annapurna AL-212 and possibly others

When trying to upgrade Go from 1.15.8 to 1.16 on my Netgear ReadyNAS RN204 and
it's Annapurna AL-212 ARM chip I ran into a compile time error:

$ cd src
go-go1.16.2/$ cd src
go-go1.16.2/src$ ./make.bash
Building Go cmd/dist using /usr/lib/go-1.15. (go1.15.8 linux/arm)
Building Go toolchain1 using /usr/lib/go-1.16.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/arm.
net(.text): unexpected relocation type 296 (R_ARM_V4BX)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x115a84]

Inspection of the changes showed that the code for handling R_ARM_V4BX that
was included in 1.15.x is mossing from 1.16 onwards. Since R_ARM_v4BX is
essentially a no-op accoring to the comment in the 1.15 tree I thought it
safe to just let it do that.

Using the patch I was able to build a working go 1.16.2, run the test suite
and build some apps for testing.

However, with me lacking deeper understanding of the code I have no idea
about possible side effects or whether there's an easier way to handle
this. So I'd be more than happy if someone with more knowledge could give
this a look.

This PR will be imported into Gerrit with the title and first
comment (this text) used to generate the subject and body of
the Gerrit change.

Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
GitHub-Last-Rev: 51ad3918e4563b072543ebed3a7012047a526d0d
GitHub-Pull-Request: golang/go#44998
---
M src/cmd/link/internal/arm/asm.go
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/cmd/link/internal/arm/asm.go b/src/cmd/link/internal/arm/asm.go
index 03caeae..32ff6e4 100644
--- a/src/cmd/link/internal/arm/asm.go
+++ b/src/cmd/link/internal/arm/asm.go
@@ -189,6 +189,12 @@
su.SetRelocType(rIdx, objabi.R_ADDR)
return true

+ case objabi.ElfRelocOffset + objabi.RelocType(elf.R_ARM_V4BX):
+ if targType == sym.SDYNIMPORT {
+ ldr.Errorf(s, "unexpected R_ARM_V4BX relocation for dynamic symbol %s", ldr.SymName(targ))
+ }
+ return true
+
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_ARM_PC24),
objabi.ElfRelocOffset + objabi.RelocType(elf.R_ARM_JUMP24):
su := ldr.MakeSymbolUpdater(s)

To view, visit change 301631. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
Gerrit-Change-Number: 301631
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Matthew Dempsky (Gerrit)

unread,
Mar 15, 2021, 12:24:52 AM3/15/21
to Gerrit Bot, goph...@pubsubhelper.golang.org, Cherry Zhang, Russ Cox, Ian Lance Taylor, Than McIntosh, Michael Hudson-Doyle, Go Bot, golang-co...@googlegroups.com

Attention is currently required from: Ian Lance Taylor, Russ Cox, Cherry Zhang.

Patch set 1:Run-TryBot +1Trust +1

View Change

2 comments:

    • This PR will be imported into Gerrit with the title and first
      comment (this text) used to generate the subject and body of
      the Gerrit change.

    • nit: remove this, and replace with "Fixes #NNNN." after filing an issue.

  • Patchset:

    • Patch Set #1:

      It seems like this should be backported to the Go 1.16 release branch and included in Go 1.16.3. Can you please file an issue for this at golang.org/issue/new so we can mark it for backport? Thanks.

To view, visit change 301631. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
Gerrit-Change-Number: 301631
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Cherry Zhang <cher...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Go Bot <go...@golang.org>
Gerrit-CC: Michael Hudson-Doyle <michael...@canonical.com>
Gerrit-CC: Than McIntosh <th...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Cherry Zhang <cher...@google.com>
Gerrit-Comment-Date: Mon, 15 Mar 2021 04:24:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Gerrit Bot (Gerrit)

unread,
Mar 15, 2021, 4:32:16 AM3/15/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Ian Lance Taylor, Russ Cox, Cherry Zhang.

Gerrit Bot uploaded patch set #2 to this change.

View Change

Fixes #45012

Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
GitHub-Last-Rev: 22f41ab73dcf2c28e4b3d9e3e71ae0c6d65531eb

GitHub-Pull-Request: golang/go#44998
---
M src/cmd/link/internal/arm/asm.go
1 file changed, 6 insertions(+), 0 deletions(-)

To view, visit change 301631. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
Gerrit-Change-Number: 301631
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Cherry Zhang <cher...@google.com>
Gerrit-Reviewer: Go Bot <go...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Michael Hudson-Doyle <michael...@canonical.com>
Gerrit-CC: Than McIntosh <th...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Cherry Zhang <cher...@google.com>
Gerrit-MessageType: newpatchset

Gopher Robot (Gerrit)

unread,
Jun 13, 2023, 6:36:59 PM6/13/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Matthew Dempsky, Cherry Mui, Russ Cox, Ian Lance Taylor, Than McIntosh, Michael Hudson-Doyle, golang-co...@googlegroups.com

Gopher Robot abandoned this change.

View Change

Abandoned GitHub PR golang/go#44998 has been closed.

To view, visit change 301631. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: abandon
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Id1d3f8c424fc47fb2e9c2cddc7887c1afdb73047
Gerrit-Change-Number: 301631
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Reply all
Reply to author
Forward
0 new messages