Opened 16 months ago

Last modified 11 months ago

#15275 new bug

AArch64 validation fails with many invalid relocations

Reported by: bgamari Owned by:
Priority: high Milestone: 8.6.1
Component: Compiler (Linking) Version: 8.4.3
Keywords: Cc: angerman, tmobile, arrowd
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Test ways requiring the RTS linker (e.g. ext-interp) are failing due to the assert(isInt64(32, addend)); assertion in the COMPAT_R_AARCH64_ADR_PREL_PG_HI21 of encodeAddendAarch64. One such relocation is,

RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE
000000000000001c R_AARCH64_ADR_PREL_PG_HI21  stg_upd_frame_info

although there are plenty of others.

Change History (6)

comment:1 Changed 16 months ago by bgamari

It seems to me that this may just be the result of us not building with -fPIC by default. It seems like fixing this would likely resolve this issue.

comment:2 Changed 15 months ago by bgamari

Sadly just enabling -fPIC by default (using DynFlags.default_PIC) seems to make no difference. The problematic relocations are still generated.

Linkers are truly awful creations.

comment:3 Changed 14 months ago by tmobile

Is there any workaround for this? I'm hitting this while cross-compiling to aarch64 running iserv in qemu.

comment:4 Changed 14 months ago by tmobile

Cc: tmobile added

comment:5 Changed 14 months ago by bgamari

Sadly, not that I know of. I have previously observed this when using ld.gold. I'm frankly quite surprised that R_AARCH64_ADR_PREL_PG_HI21 given that we are compiling with -fPIC. I rather suspect this may be (yet another) linker bug. I'm currently trying a build linked with ld.bfd to see if it exhibits the same issue.

comment:6 Changed 11 months ago by arrowd

Cc: arrowd added
Note: See TracTickets for help on using tickets.