diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-09-26 07:10:15 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-09-26 07:12:54 +0000 |
commit | 1697a0c40bf4b94de03afba1d558ac2095c6dbcc (patch) | |
tree | e77eeab6b861fb2e2853011a5d2c089323578889 /main/pax-utils/fix-eitype.patch | |
parent | 7626b4937b8a1abb3f4923c79d044bb4000291a7 (diff) | |
download | aports-1697a0c40bf4b94de03afba1d558ac2095c6dbcc.tar.bz2 aports-1697a0c40bf4b94de03afba1d558ac2095c6dbcc.tar.xz |
main/pax-utils: fix printing osabi, modernize
Diffstat (limited to 'main/pax-utils/fix-eitype.patch')
-rw-r--r-- | main/pax-utils/fix-eitype.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/main/pax-utils/fix-eitype.patch b/main/pax-utils/fix-eitype.patch new file mode 100644 index 0000000000..fe54ee8874 --- /dev/null +++ b/main/pax-utils/fix-eitype.patch @@ -0,0 +1,28 @@ +elf->data is 'signed char' and casting it to 'int' will sign extend. +Most non-intrusive fix is to just have get_elfeitype() take type as +'unsigned char' to make implicit cast. + +diff -ru pax-utils-1.2.2.orig/paxelf.c pax-utils-1.2.2/paxelf.c +--- pax-utils-1.2.2.orig/paxelf.c 2017-01-24 20:24:53.000000000 +0000 ++++ pax-utils-1.2.2/paxelf.c 2017-09-26 07:01:00.115498082 +0000 +@@ -65,7 +65,7 @@ + QUERY(ELFOSABI_STANDALONE), + { 0, 0 } + }; +-const char *get_elfeitype(int ei_type, int type) ++const char *get_elfeitype(int ei_type, unsigned char type) + { + switch (ei_type) { + case EI_CLASS: return find_pairtype(elf_ei_class, type); +diff -ru pax-utils-1.2.2.orig/paxelf.h pax-utils-1.2.2/paxelf.h +--- pax-utils-1.2.2.orig/paxelf.h 2017-01-24 20:24:53.000000000 +0000 ++++ pax-utils-1.2.2/paxelf.h 2017-09-26 07:00:44.941879820 +0000 +@@ -56,7 +56,7 @@ + extern elfobj *_readelf(const char *filename, int read_only); + #define readelf(filename) _readelf(filename, 1) + extern void unreadelf(elfobj *elf); +-extern const char *get_elfeitype(int ei_type, int type); ++extern const char *get_elfeitype(int ei_type, unsigned char type); + extern const char *get_elfetype(elfobj *elf); + extern const char *get_endian(elfobj *elf); + extern const char *get_elfosabi(elfobj *elf); |