more messages in PackLinuxElf32::canPack
This commit is contained in:
parent
ece7384be4
commit
de9b9fd0b1
@ -1184,8 +1184,10 @@ bool PackLinuxElf32::canPack()
|
|||||||
Elf32_Phdr const *phdr = (Elf32_Phdr const *)(u.buf + e_phoff);
|
Elf32_Phdr const *phdr = (Elf32_Phdr const *)(u.buf + e_phoff);
|
||||||
note_size = 0;
|
note_size = 0;
|
||||||
for (unsigned j=0; j < e_phnum; ++phdr, ++j) {
|
for (unsigned j=0; j < e_phnum; ++phdr, ++j) {
|
||||||
if (j >= 14)
|
if (j >= 14) {
|
||||||
return false;
|
throwCantPack("too many Elf32_Phdr; try '--force-execve'");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
unsigned const p_type = get_te32(&phdr->p_type);
|
unsigned const p_type = get_te32(&phdr->p_type);
|
||||||
unsigned const p_offset = get_te32(&phdr->p_offset);
|
unsigned const p_offset = get_te32(&phdr->p_offset);
|
||||||
if (1!=exetype && phdr->PT_LOAD32 == p_type) {
|
if (1!=exetype && phdr->PT_LOAD32 == p_type) {
|
||||||
@ -1319,8 +1321,12 @@ bool PackLinuxElf32::canPack()
|
|||||||
if (elf_find_dynamic(Elf32_Dyn::DT_INIT)) {
|
if (elf_find_dynamic(Elf32_Dyn::DT_INIT)) {
|
||||||
if (this->e_machine!=Elf32_Ehdr::EM_386)
|
if (this->e_machine!=Elf32_Ehdr::EM_386)
|
||||||
goto abandon; // need stub: EM_ARM EM_MIPS EM_PPC
|
goto abandon; // need stub: EM_ARM EM_MIPS EM_PPC
|
||||||
if (elf_has_dynamic(Elf32_Dyn::DT_TEXTREL))
|
if (elf_has_dynamic(Elf32_Dyn::DT_TEXTREL)) {
|
||||||
|
shdri = NULL;
|
||||||
|
phdri = NULL;
|
||||||
|
throwCantPack("re-compile with -fPIC to remove DT_TEXTREL");
|
||||||
goto abandon;
|
goto abandon;
|
||||||
|
}
|
||||||
Elf32_Shdr const *shdr = shdri;
|
Elf32_Shdr const *shdr = shdri;
|
||||||
xct_va = ~0u;
|
xct_va = ~0u;
|
||||||
for (j= n_elf_shnum; --j>=0; ++shdr) {
|
for (j= n_elf_shnum; --j>=0; ++shdr) {
|
||||||
@ -1340,6 +1346,9 @@ bool PackLinuxElf32::canPack()
|
|||||||
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERDEF)
|
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERDEF)
|
||||||
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERSYM)
|
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERSYM)
|
||||||
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERNEEDED) ) {
|
|| xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERNEEDED) ) {
|
||||||
|
phdri = NULL;
|
||||||
|
shdri = NULL;
|
||||||
|
throwCantPack("DT_ tag above stub");
|
||||||
goto abandon;
|
goto abandon;
|
||||||
}
|
}
|
||||||
for ((shdr= shdri), (j= n_elf_shnum); --j>=0; ++shdr) {
|
for ((shdr= shdri), (j= n_elf_shnum); --j>=0; ++shdr) {
|
||||||
@ -1357,10 +1366,12 @@ bool PackLinuxElf32::canPack()
|
|||||||
else
|
else
|
||||||
infoWarning("no DT_INIT: %s", fi->getName());
|
infoWarning("no DT_INIT: %s", fi->getName());
|
||||||
abandon:
|
abandon:
|
||||||
phdri = 0; // Done with this
|
phdri = NULL; // Done with this
|
||||||
|
shdri = NULL;
|
||||||
return false;
|
return false;
|
||||||
proceed:
|
proceed:
|
||||||
phdri = 0;
|
phdri = NULL;
|
||||||
|
shdri = NULL;
|
||||||
}
|
}
|
||||||
// XXX Theoretically the following test should be first,
|
// XXX Theoretically the following test should be first,
|
||||||
// but PackUnix::canPack() wants 0!=exetype ?
|
// but PackUnix::canPack() wants 0!=exetype ?
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user