Comment 44 for bug 1533009

Revision history for this message
Kj (ksingh2017) wrote :

I came across the same issue today (2/2/2017), i.e. "unsupported RELA relocation: 275", while using "Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-59-generic aarch64)". I read above messages and have verified that arch/arm64/Makefile does have -mpc-relative-literal-loads as shown below. The kernel config file also has CONFIG_ARM64_ERRATUM_843419=y.

However, module.c shows "#ifndef CONFIG_ARM64_ERRATUM_843419". Shouldn't this be #ifdef instead? Could it be that I'm seeing the error message since #ifndef compiled out "case R_AARCH64_ADR_PREL_PG_HI21" (275)?

ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
 KBUILD_CFLAGS_MODULE += -mcmodel=large
 KBUILD_CFLAGS_MODULE += $(call cc-option, -mpc-relative-literal-loads)
endif

File: arch/arm64/kernel/module.c
Linux Kernel Version: 4.9

 195int apply_relocate_add(Elf64_Shdr *sechdrs,
 196 const char *strtab,
 197 unsigned int symindex,
 198 unsigned int relsec,
 199 struct module *me)
 200{
 ...
 334#ifndef CONFIG_ARM64_ERRATUM_843419
 335 case R_AARCH64_ADR_PREL_PG_HI21_NC:
 336 overflow_check = false;
 337 case R_AARCH64_ADR_PREL_PG_HI21:
 338 ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21,
 339 AARCH64_INSN_IMM_ADR);
 340 break;
 341#endif