slink.exe: $(SRC)
- wcl -fe=$@ $^
+ wcl -ml -fe=$@ $^
clean:
static void translate_relocation (struct reloc_entry *reloc, struct coff_relocation_entry *input, struct section_part *part) {
+ uint16_t type;
+
reloc->symbol = part->of->symbol_arr + array_to_integer (input->SymbolTableIndex, 4, 0);
reloc->offset = array_to_integer (input->VirtualAddress, 4, 0);
- switch (array_to_integer (input->Type, 2, 0)) {
+ type = array_to_integer (input->Type, 2, 0);
+
+ switch (type) {
case IMAGE_REL_I386_ABSOLUTE:
};
-#define LD_TARGET_MACHINE_AARCH64 (1U << 15)
-#define LD_TARGET_MACHINE_AMD64 (1U << 14)
-#define LD_TARGET_MACHINE_I386 (1U << 13)
+#define LD_TARGET_MACHINE_AARCH64 (1U << 14)
+#define LD_TARGET_MACHINE_AMD64 (1U << 13)
+#define LD_TARGET_MACHINE_I386 (1U << 12)
#define LD_EMULATION_NONE 0x00
static void reloc_generic (struct section_part *part, struct reloc_entry *rel, struct symbol *symbol) {
unsigned char opcode = (part->content + rel->offset - 1)[0];
- uint64_t result = 0, size = rel->howto->size, offset = rel->offset;
+ int size = rel->howto->size;
+
+ uint64_t result = 0, offset = rel->offset;
switch (size) {