310-arm_module_unresolved_weak_sym.patch 615 B

12345678910111213141516171819202122
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Subject: fix errors in unresolved weak symbols on arm
  3. lede-commit: 570699d4838a907c3ef9f2819bf19eb72997b32f
  4. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  5. ---
  6. arch/arm/kernel/module.c | 4 ++++
  7. 1 file changed, 4 insertions(+)
  8. --- a/arch/arm/kernel/module.c
  9. +++ b/arch/arm/kernel/module.c
  10. @@ -95,6 +95,10 @@ apply_relocate(Elf32_Shdr *sechdrs, cons
  11. return -ENOEXEC;
  12. }
  13. + if ((IS_ERR_VALUE(sym->st_value) || !sym->st_value) &&
  14. + ELF_ST_BIND(sym->st_info) == STB_WEAK)
  15. + continue;
  16. +
  17. loc = dstsec->sh_addr + rel->r_offset;
  18. switch (ELF32_R_TYPE(rel->r_info)) {