shithub: scc

Download patch

ref: 1da7f45ae0e42aff174c695d948449bf22bf4b33
parent: e7b81f3f5b0030211190271574d1ade27dfab317
author: Hiltjo Posthuma <hiltjo@codemadness.org>
date: Wed May 30 15:28:03 EDT 2018

add support for i386 magic value in the file header

--- a/inc/coff32/filehdr.h
+++ b/inc/coff32/filehdr.h
@@ -22,4 +22,5 @@
 #define F_AR32WR (1 << 5)
 #define F_A32WR  (1 << 6)
 
+#define COFF_I386MAGIC    0x014c
 #define COFF_Z80MAGIC     0x805a
--- a/ld/coff32.c
+++ b/ld/coff32.c
@@ -413,6 +413,7 @@
 	magic = c1 | c2 << 8;
 
 	switch (magic) {
+	case COFF_I386MAGIC:
 	case COFF_Z80MAGIC:
 		unpack = lunpack;
 		align = 2;
--- a/nm/coff32.c
+++ b/nm/coff32.c
@@ -259,6 +259,7 @@
 	magic = buff[0] | buff[1] << 8;
 
 	switch (magic) {
+	case COFF_I386MAGIC:
 	case COFF_Z80MAGIC:
 		unpack = lunpack;
 		break;
@@ -307,6 +308,7 @@
 	magic = c1 | c2 << 8;
 
 	switch (magic) {
+	case COFF_I386MAGIC:
 	case COFF_Z80MAGIC:
 		return 1;
 	default: