diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2007-07-16 16:39:35 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2007-07-16 16:39:35 -0400 |
commit | 56a974fa2d595fe6ebe433c525b8232ead539b76 (patch) | |
tree | 7bbd0ac6d95e9b169176999efbaf633d9f87c7ed /scripts/mod/modpost.c | |
parent | ae4ac12323c0ff80528cac3269151d580e23f923 (diff) |
kbuild: make better section mismatch reports on arm
With this change we can find more symbols hereby improving
the readability of the warnings.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index b83cddb8dca9..256b3d272e2e 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -929,6 +929,26 @@ static int addend_386_rel(struct elf_info *elf, int rsection, Elf_Rela *r) | |||
929 | return 0; | 929 | return 0; |
930 | } | 930 | } |
931 | 931 | ||
932 | static int addend_arm_rel(struct elf_info *elf, int rsection, Elf_Rela *r) | ||
933 | { | ||
934 | unsigned int r_typ = ELF_R_TYPE(r->r_info); | ||
935 | |||
936 | switch (r_typ) { | ||
937 | case R_ARM_ABS32: | ||
938 | /* From ARM ABI: (S + A) | T */ | ||
939 | r->r_addend = (int)(long)(elf->symtab_start + ELF_R_SYM(r->r_info)); | ||
940 | break; | ||
941 | case R_ARM_PC24: | ||
942 | /* From ARM ABI: ((S + A) | T) - P */ | ||
943 | r->r_addend = (int)(long)(elf->hdr + elf->sechdrs[rsection].sh_offset + | ||
944 | (r->r_offset - elf->sechdrs[rsection].sh_addr)); | ||
945 | break; | ||
946 | default: | ||
947 | return 1; | ||
948 | } | ||
949 | return 0; | ||
950 | } | ||
951 | |||
932 | static int addend_mips_rel(struct elf_info *elf, int rsection, Elf_Rela *r) | 952 | static int addend_mips_rel(struct elf_info *elf, int rsection, Elf_Rela *r) |
933 | { | 953 | { |
934 | unsigned int r_typ = ELF_R_TYPE(r->r_info); | 954 | unsigned int r_typ = ELF_R_TYPE(r->r_info); |
@@ -1051,6 +1071,10 @@ static void check_sec_ref(struct module *mod, const char *modname, | |||
1051 | if (addend_386_rel(elf, i, &r)) | 1071 | if (addend_386_rel(elf, i, &r)) |
1052 | continue; | 1072 | continue; |
1053 | break; | 1073 | break; |
1074 | case EM_ARM: | ||
1075 | if(addend_arm_rel(elf, i, &r)) | ||
1076 | continue; | ||
1077 | break; | ||
1054 | case EM_MIPS: | 1078 | case EM_MIPS: |
1055 | if (addend_mips_rel(elf, i, &r)) | 1079 | if (addend_mips_rel(elf, i, &r)) |
1056 | continue; | 1080 | continue; |