@@ -67,6 +67,7 @@ def gen_core_syms(syms_toml: TextIO, datasyms_toml: TextIO):
67
67
value = sym .entry ["st_value" ]
68
68
size = sym .entry ["st_size" ]
69
69
st_shndx = sym .entry ["st_shndx" ]
70
+ st_info_type = sym .entry ["st_info" ]["type" ]
70
71
71
72
if sym .name .startswith ("L8" ):
72
73
continue
@@ -92,11 +93,9 @@ def gen_core_syms(syms_toml: TextIO, datasyms_toml: TextIO):
92
93
pass
93
94
elif value >= text_end :
94
95
# Data
95
- if st_shndx != "SHN_ABS" :
96
- continue
97
-
98
- data_global = { "name" : sym .name , "vram" : value }
99
- data_globals .append (data_global )
96
+ if (st_info_type == "STT_NOTYPE" and st_shndx == "SHN_ABS" ) or (st_info_type == "STT_OBJECT" ):
97
+ data_global = { "name" : sym .name , "vram" : value }
98
+ data_globals .append (data_global )
100
99
101
100
# Add any functions defined in the hacks table that wasn't found in the .elf
102
101
for (vram , hack ) in FUNCTION_DEF_HACKS .items ():
@@ -105,7 +104,9 @@ def gen_core_syms(syms_toml: TextIO, datasyms_toml: TextIO):
105
104
funcs .append (func )
106
105
print ("Adding manual function definition {} @ 0x{:X} with size 0x{:X}" .format (hack ["name" ], vram , hack ["size" ]))
107
106
107
+ # Sort
108
108
funcs .sort (key = lambda f : f ["vram" ])
109
+ data_globals .sort (key = lambda f : f ["vram" ])
109
110
110
111
# Write function symbols
111
112
syms_toml .write ("[[section]]\n " )
0 commit comments