Skip to content

Commit

Permalink
kbuild: make better section mismatch reports on arm
Browse files Browse the repository at this point in the history
With this change we can find more symbols hereby improving
the readability of the warnings.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
sravnborg committed Jul 16, 2007
1 parent ae4ac12 commit 56a974f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,26 @@ static int addend_386_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
return 0;
}

static int addend_arm_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
{
unsigned int r_typ = ELF_R_TYPE(r->r_info);

switch (r_typ) {
case R_ARM_ABS32:
/* From ARM ABI: (S + A) | T */
r->r_addend = (int)(long)(elf->symtab_start + ELF_R_SYM(r->r_info));
break;
case R_ARM_PC24:
/* From ARM ABI: ((S + A) | T) - P */
r->r_addend = (int)(long)(elf->hdr + elf->sechdrs[rsection].sh_offset +
(r->r_offset - elf->sechdrs[rsection].sh_addr));
break;
default:
return 1;
}
return 0;
}

static int addend_mips_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
{
unsigned int r_typ = ELF_R_TYPE(r->r_info);
Expand Down Expand Up @@ -1051,6 +1071,10 @@ static void check_sec_ref(struct module *mod, const char *modname,
if (addend_386_rel(elf, i, &r))
continue;
break;
case EM_ARM:
if(addend_arm_rel(elf, i, &r))
continue;
break;
case EM_MIPS:
if (addend_mips_rel(elf, i, &r))
continue;
Expand Down

0 comments on commit 56a974f

Please sign in to comment.