modpost: remove unused Elf_Sword macro
PATCH 1/1 modpost: remove unused Elf_Sword macro
Commit 9ad21c3f3ecf ("kbuild: try harder to find symbol names in modpost") added Elf_Sword (in a wrong way), but did not use it at all.
BTW, the current code looks weird.
The fix for the 32-bit part would be:
Elf64_Sword --> Elf32_Sword
(weirdness in the prefix, Elf32_ vs Elf64_)
The fix for the 64-bit part would be:
Elf64_Sxword --> Elf64_Sword
(the size is different between Sword and Sxword)
Note:
Elf32_Sword == Elf64_Sword == int32_t
Elf32_Sxword == Elf64_Sxword == int64_tAnyway, let's drop unused code instead of fixing it.
---
scripts/mod/modpost.h | 2 -- 1 file changed, 2 deletions(-)
scripts/mod/modpost.h +0 -2
@@ -26,7 +26,6 @@#define Elf_Shdr Elf32_Shdr#define Elf_Sym Elf32_Sym#define Elf_Addr Elf32_Addr -#define Elf_Sword Elf64_Sword#define Elf_Section Elf32_Half#define ELF_ST_BIND ELF32_ST_BIND#define ELF_ST_TYPE ELF32_ST_TYPE
@@ -41,7 +40,6 @@#define Elf_Shdr Elf64_Shdr#define Elf_Sym Elf64_Sym#define Elf_Addr Elf64_Addr -#define Elf_Sword Elf64_Sxword#define Elf_Section Elf64_Half#define ELF_ST_BIND ELF64_ST_BIND#define ELF_ST_TYPE ELF64_ST_TYPE
Signature · 1 line
2.34.1
Quoted 18 lines · Masahiro Yamada
Commit
9ad21c3f3ecf("kbuild: try harder to find symbol names in modpost") addedElf_Sword(in a wrong way), but did not use it at all.BTW, the current code looks weird.
The fix for the 32-bit part would be:
Elf64_Sword --> Elf32_Sword(weirdness in the prefix,
Elf32_vsElf64_)The fix for the 64-bit part would be:
Elf64_Sxword --> Elf64_Sword(the size is different between Sword and Sxword)
Quoted 8 lines
Note:
Elf32_Sword == Elf64_Sword == int32_t Elf32_Sxword == Elf64_Sxword == int64_tAnyway, let's drop unused code instead of fixing it.
Signed-off-by Masahiro Yamada <[email protected]>
Thanks for the patch!
Quoted 28 lines
---
scripts/mod/modpost.h | 2 -- 1 file changed, 2 deletions(-)scripts/mod/modpost.h +0
-3@@ -26,7 +26,6 @@#define Elf_Shdr Elf32_Shdr#define Elf_Sym Elf32_Sym#define Elf_Addr Elf32_Addr -#define Elf_Sword Elf64_Sword#define Elf_Section Elf32_Half#define ELF_ST_BIND ELF32_ST_BIND#define ELF_ST_TYPE ELF32_ST_TYPE@@ -41,7 +40,6 @@#define Elf_Shdr Elf64_Shdr#define Elf_Sym Elf64_Sym#define Elf_Addr Elf64_Addr -#define Elf_Sword Elf64_Sxword#define Elf_Section Elf64_Half#define ELF_ST_BIND ELF64_ST_BIND#define ELF_ST_TYPE ELF64_ST_TYPE --2.34.1
Signature · 2 lines
Thanks, ~Nick Desaulniers