Fix ordering of relocations in overlay (#32)

This commit is contained in:
Rozelette 2020-09-27 19:18:45 -05:00 committed by GitHub
parent c725249389
commit a672633c3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -28,8 +28,9 @@ if __name__ == '__main__':
out.write('.section .ovl\n');
relocs = []
for section in elffile.iter_sections():
if isinstance(section, RelocationSection):
for section_name in ['.rel.text', '.rel.data', '.rel.rodata']:
section = elffile.get_section_by_name(section_name)
if section is not None:
symtab = elffile.get_section(section['sh_link'])
for reloc in section.iter_relocations():
symbol = symtab.get_symbol(reloc['r_info_sym'])