break;\r
\r
case R_AARCH64_CALL26:\r
- if (Rel->r_addend != 0 ) { /* TODO */\r
- Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_CALL26 Need to fixup with addend!.");\r
- }\r
- break;\r
-\r
case R_AARCH64_JUMP26:\r
- if (Rel->r_addend != 0 ) { /* TODO : AArch64 '-O2' optimisation. */\r
+ if (Rel->r_addend != 0 ) {\r
+ // Some references to static functions sometime start at the base of .text + addend.\r
+ // It is safe to ignore these relocations because they patch a `BL` instructions that\r
+ // contains an offset from the instruction itself and there is only a single .text section.\r
+ // So we check if the symbol is a "section symbol"\r
+ if (ELF64_ST_TYPE (Sym->st_info) == STT_SECTION) {\r
+ break;\r
+ }\r
Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_JUMP26 Need to fixup with addend!.");\r
}\r
break;\r