switch (fixup->reloc_type) {
case RELOC_TYPE_DEFAULT:
- case RELOC_TYPE_FAR_CALL:
switch (fixup->size) {
}
- } else {
+ } else if (state->format == AS_OUTPUT_WIN32) {
switch (fixup->reloc_type) {
case RELOC_TYPE_DEFAULT:
- case RELOC_TYPE_FAR_CALL:
switch (fixup->size) {
case RELOC_TYPE_RVA:
+ if (fixup->size != 4) {
+
+ report_at (__FILE__, __LINE__, REPORT_INTERNAL_ERROR, "unsupported COFF relocation size %i for reloc_type RELOC_TYPE_RVA", fixup->size);
+ exit (EXIT_FAILURE);
+
+ }
+
type = IMAGE_REL_I386_DIR32NB;
break;
|| (instruction.index_reg && (!instruction.index_reg->type.base_index || !instruction.index_reg->type.qword))) {
goto bad;
}
+
+ return 0;
+
+ }
- } else if (bits == 32) {
+ if (bits == 32 || cpu_arch_flags.cpu_386) {
if ((instruction.base_reg && !instruction.base_reg->type.dword) || (instruction.index_reg && (!instruction.index_reg->type.base_index || !instruction.index_reg->type.dword))) {
- goto bad;
+ goto _check16;
}
+
+ return 0;
- } else {
+ }
- if ((instruction.base_reg && (!instruction.base_reg->type.base_index || !instruction.base_reg->type.word))
- || (instruction.index_reg && (!instruction.index_reg->type.base_index || !instruction.index_reg->type.word
- || !(instruction.base_reg && instruction.base_reg->number < 6 && instruction.index_reg->number >= 6
- && instruction.log2_scale_factor == 0)))) {
- goto bad;
- }
+_check16:
+ if ((instruction.base_reg && (!instruction.base_reg->type.base_index || !instruction.base_reg->type.word))
+ || (instruction.index_reg && (!instruction.index_reg->type.base_index || !instruction.index_reg->type.word
+ || !(instruction.base_reg && instruction.base_reg->number < 6 && instruction.index_reg->number >= 6
+ && instruction.log2_scale_factor == 0)))) {
+ goto bad;
}
return 0;