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

Helflym opened this issue Aug 6, 2020 · 1 comment


Copy link

@Helflym 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.


@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 this to the Backlog milestone Aug 7, 2020
Copy link

@toothrot toothrot commented Aug 7, 2020


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants