From a672633c3bcaea1e92080bcb48fc5dc8fddb1799 Mon Sep 17 00:00:00 2001 From: Rozelette Date: Sun, 27 Sep 2020 19:18:45 -0500 Subject: [PATCH] Fix ordering of relocations in overlay (#32) --- tools/overlay.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/overlay.py b/tools/overlay.py index b7fe496997..8fdc6239f8 100755 --- a/tools/overlay.py +++ b/tools/overlay.py @@ -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'])