Bug 628627 part 1 - Raise hard errors in some more cases in elfhack. r=tglek,a=sdwilsh

This commit is contained in:
Mike Hommey 2011-01-28 09:22:58 +01:00
parent 5dd0060e02
commit 5190cd7346
2 changed files with 8 additions and 3 deletions

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#undef NDEBUG
#include <cstring>
#include <assert.h>
#include "elfxx.h"
@ -653,6 +654,10 @@ void ElfDynamic_Section::setValueForType(unsigned int tag, ElfValue *val)
if (i < shdr.sh_size / shdr.sh_entsize)
return;
// Growing the .dynamic section needs it to be moved depending where it
// was originally. Growing it blindly is dangerous. Safer to just fail
// for now
throw std::runtime_error("Growing .dynamic section is unsupported");
Elf_DynValue value;
value.tag = DT_NULL;
value.value = NULL;

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#undef NDEBUG
#include <assert.h>
#include <cstring>
#include <cstdlib>
@ -255,8 +256,7 @@ private:
// This is for R_ARM_V4BX, until we find something better
addr = -1;
} else {
fprintf(stderr, "Unsupported symbol in relocation: %s\n", name);
break;
throw std::runtime_error("Unsupported symbol in relocation");
}
} else {
ElfSection *section = elf->getSection(symtab->syms[ELF32_R_SYM(r->r_info)].st_shndx);
@ -283,7 +283,7 @@ private:
// Ignore R_ARM_V4BX relocations
break;
default:
fprintf(stderr, "Unsupported relocation type\n");
throw std::runtime_error("Unsupported relocation type");
}
}
}