make_st_info()
This commit is contained in:
+5
-1
@@ -169,7 +169,7 @@ struct Sym
|
|||||||
|
|
||||||
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
|
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
|
||||||
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
|
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
|
||||||
static unsigned char get_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
|
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
|
||||||
}
|
}
|
||||||
__attribute_packed;
|
__attribute_packed;
|
||||||
|
|
||||||
@@ -248,6 +248,10 @@ struct Sym
|
|||||||
|
|
||||||
# define WANT_SYM_ENUM 1
|
# define WANT_SYM_ENUM 1
|
||||||
# include "p_elf_enum.h"
|
# include "p_elf_enum.h"
|
||||||
|
|
||||||
|
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
|
||||||
|
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
|
||||||
|
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
|
||||||
}
|
}
|
||||||
__attribute_packed;
|
__attribute_packed;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -863,7 +863,7 @@ bool PackLinuxElf32::canPack()
|
|||||||
// elf_lookup() returns 0 if any required table is missing.
|
// elf_lookup() returns 0 if any required table is missing.
|
||||||
Elf32_Sym const *const lsm = elf_lookup(run_start[j]);
|
Elf32_Sym const *const lsm = elf_lookup(run_start[j]);
|
||||||
if (lsm && get_native16(&lsm->st_shndx)==Elf32_Sym::SHN_UNDEF
|
if (lsm && get_native16(&lsm->st_shndx)==Elf32_Sym::SHN_UNDEF
|
||||||
&& get_native16(&lsm->st_info)==lsm->Elf32_Sym::get_st_info(Elf32_Sym::STB_GLOBAL, Elf32_Sym::STT_FUNC)
|
&& get_native16(&lsm->st_info)==lsm->Elf32_Sym::make_st_info(Elf32_Sym::STB_GLOBAL, Elf32_Sym::STT_FUNC)
|
||||||
&& get_native16(&lsm->st_other)==Elf32_Sym::STV_DEFAULT ) {
|
&& get_native16(&lsm->st_other)==Elf32_Sym::STV_DEFAULT ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user