shithub: scc

Download patch

ref: 8d03b46d52b27f48a684587c28e59a79be2aab01
parent: c31d542ae4bfebfe4d44b0b4003ae9c9dc613b51
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri May 11 04:01:04 EDT 2018

[ld/coff32] Support for short names in symbols

Coff32 supports longer names using an union with the name of the
symbol.

--- a/ld/coff32.c
+++ b/ld/coff32.c
@@ -102,6 +102,8 @@
 getsym(unsigned char *buff, SYMENT *ent)
 {
 	int n;
+	long off, zero;
+	char *name;
 
 	n = (*unpack)(buff,
 		      "'8lsscc",
@@ -112,6 +114,10 @@
 		      &ent->n_sclass,
 		      &ent->n_numaux);
 	assert(n == SYMESZ);
+
+	name = ent->n_name;
+	if (!name[0] && !name[1] && !name[2] && !name[3])
+		(*unpack)(buff, "ll", &ent->n_zeroes, &ent->n_offset);
 }
 
 static int