mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Use better name osabi_note.
This commit is contained in:
parent
a8ddf8f66d
commit
0d1f12e31a
|
@ -141,7 +141,7 @@ PackLinuxElf64::checkEhdr(Elf64_Ehdr const *ehdr) const
|
|||
PackLinuxElf::PackLinuxElf(InputFile *f)
|
||||
: super(f), file_image(NULL), dynstr(NULL),
|
||||
sz_phdrs(0), sz_elf_hdrs(0),
|
||||
e_machine(0), ei_class(0), ei_data(0), ei_osabi(0), pt_note(NULL)
|
||||
e_machine(0), ei_class(0), ei_data(0), ei_osabi(0), osabi_note(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -835,7 +835,7 @@ bool PackLinuxElf32::canPack()
|
|||
exetype = 1;
|
||||
}
|
||||
if (Elf32_Ehdr::ELFOSABI_NONE==osabi0 // Still seems to be generic.
|
||||
&& phdr->PT_NOTE == get_native32(&phdr->p_type)) {
|
||||
&& NULL!=osabi_note && phdr->PT_NOTE == get_native32(&phdr->p_type)) {
|
||||
unsigned const offset = get_native32(&phdr->p_offset);
|
||||
struct Elf32_Note note; memset(¬e, 0, sizeof(note));
|
||||
fi->seek(offset, SEEK_SET);
|
||||
|
@ -844,9 +844,8 @@ bool PackLinuxElf32::canPack()
|
|||
if (4==get_native32(¬e.descsz)
|
||||
&& 1==get_native32(¬e.type)
|
||||
&& 0==note.end
|
||||
&& NULL!=pt_note
|
||||
&& (1+ strlen(pt_note))==get_native32(¬e.namesz)
|
||||
&& 0==strcmp(pt_note, (char const *)¬e.text)
|
||||
&& (1+ strlen(osabi_note))==get_native32(¬e.namesz)
|
||||
&& 0==strcmp(osabi_note, (char const *)¬e.text)
|
||||
) {
|
||||
osabi0 = ei_osabi; // Specified by PT_NOTE.
|
||||
}
|
||||
|
@ -1955,7 +1954,7 @@ PackFreeBSDElf32x86::~PackFreeBSDElf32x86()
|
|||
PackNetBSDElf32x86::PackNetBSDElf32x86(InputFile *f) : super(f)
|
||||
{
|
||||
ei_osabi = Elf32_Ehdr::ELFOSABI_NETBSD;
|
||||
pt_note = "NetBSD";
|
||||
osabi_note = "NetBSD";
|
||||
}
|
||||
|
||||
PackNetBSDElf32x86::~PackNetBSDElf32x86()
|
||||
|
@ -1965,7 +1964,7 @@ PackNetBSDElf32x86::~PackNetBSDElf32x86()
|
|||
PackOpenBSDElf32x86::PackOpenBSDElf32x86(InputFile *f) : super(f)
|
||||
{
|
||||
ei_osabi = Elf32_Ehdr::ELFOSABI_OPENBSD;
|
||||
pt_note = "OpenBSD";
|
||||
osabi_note = "OpenBSD";
|
||||
}
|
||||
|
||||
PackOpenBSDElf32x86::~PackOpenBSDElf32x86()
|
||||
|
|
|
@ -76,7 +76,7 @@ protected:
|
|||
unsigned char ei_class;
|
||||
unsigned char ei_data;
|
||||
unsigned char ei_osabi;
|
||||
char const *pt_note;
|
||||
char const *osabi_note;
|
||||
};
|
||||
|
||||
class PackLinuxElf32 : public PackLinuxElf
|
||||
|
|
Loading…
Reference in New Issue
Block a user