Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: Relocation overflow occurring when calling crosscall2 on aix/ppc64 #40609

Open
Helflym opened this issue Aug 6, 2020 · 1 comment
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX
Milestone

Comments

@Helflym
Copy link
Contributor

Helflym commented Aug 6, 2020

While trying to compile metricbeat (with go1.15rc1 and 1.14.6), we discovered that a relocation overflow might occur when a CGO generated file tries to call crosscall2.

ld: 0711-780 SEVERE ERROR: Symbol .CallbackSubscr (entry 49130) in object /tmp/golang/000019.o:
       Relocation overflow in reference to: .crosscall2 (entry 6)
       Address: 0x0000004c;    RLD type: R_RBR;   RLD length: 26

I don't really know why ld isn't able to generate a trampoline but we don't want one anyway as it might end up being added inside Golang generated .text section, changing the offset, alignement, etc. The problem already happened with kubernetes where we decided to add __attribute__((longcall)) for a few runtime/cgo functions (cf gcc_aix_ppc64.c).

It's possible to do the same thing in generated CGO code (here), but I don't know if it's possible to add it only for AIX ? Moreover, could it be merged for 1.15 (and maybe backported to 1.14) ? This error is not a new one, thus I don't remember if it's possible to merge it this late in the cycle.

@fearful-symmetry

@Helflym Helflym changed the title cmd/cgo: Relocation overflow occurring when calling crosscall2 cmd/cgo: Relocation overflow occurring when calling crosscall2 on aix/ppc64 Aug 6, 2020
@toothrot toothrot added OS-AIX NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 7, 2020
@toothrot toothrot added this to the Backlog milestone Aug 7, 2020
@toothrot
Copy link
Contributor

toothrot commented Aug 7, 2020

/cc @ianlancetaylor

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX
Projects
Status: Triage Backlog
Development

No branches or pull requests

3 participants