diff ticoff/tables.c @ 127:a314d6aa9bf1

tiobjd: section disasm mode hinting rethought
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 05 Apr 2014 20:00:46 +0000
parents 2c6b1319383b
children
line wrap: on
line diff
--- a/ticoff/tables.c	Sat Apr 05 19:14:43 2014 +0000
+++ b/ticoff/tables.c	Sat Apr 05 20:00:46 2014 +0000
@@ -78,7 +78,18 @@
 		sections[n].nsymbols = 0;
 		sections[n].sorted_symbols = 0;
 		sections[n].int_relocs = 0;
-		sections[n].sectype_hint = 0;
+		if (!strncmp(sections[n].name, ".text", 5))
+			sections[n].disasm_mode = DISASM_MODE_CODE;
+		else if (!strcmp(sections[n].name, ".const"))
+			sections[n].disasm_mode = DISASM_MODE_DATA;
+		else if (!strcmp(sections[n].name, ".cinit"))
+			sections[n].disasm_mode = DISASM_MODE_DATA;
+		else if (!strcmp(sections[n].name, ".data"))
+			sections[n].disasm_mode = DISASM_MODE_DATA;
+		else if (!strcmp(sections[n].name, ".bss"))
+			sections[n].disasm_mode = DISASM_MODE_BSS;
+		else
+			sections[n].disasm_mode = DISASM_MODE_UNKNOWN;
 		sections[n].hints = 0;
 	}
 }