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.