From b6d967262af7cc54363ad2a93550703510fdcbc9 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sat, 21 Aug 2021 11:15:59 +0200 Subject: [PATCH] improvments to debugging symbols emitted by package.py script --- package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.py b/package.py index c05499b..5b80a75 100644 --- a/package.py +++ b/package.py @@ -169,6 +169,7 @@ class MemImageCreator: print(f" - data {pos:x}:{len(self.data):x}") f.write(self.data[pos : len(self.data)]) if len(self.data) % SECTOR_SIZE != 0: + self.dbg_nfo['sections'][len(self.data)] = ':.empty' print(f" - zeros {len(self.data):x}:{(SECTOR_SIZE - (len(self.data) % SECTOR_SIZE))+len(self.data):x}") f.write(bytes(SECTOR_SIZE - (len(self.data) % SECTOR_SIZE))) # done! @@ -186,6 +187,7 @@ def package(kernel: str, binaries: List[str], out: str): # process kernel img.seek(MEM_START) kernel = Bin(kernel) + kernel.name = 'kernel' # make sure kernel is marked kernel in debug symbols bin_table_addr = kernel.symtab.get(KERNEL_BINARY_TABLE, 0) - kernel.start + MEM_START print(f"kernel binary loaded, binary table located at: {bin_table_addr:x} (symtab addr {kernel.symtab.get(KERNEL_BINARY_TABLE, '??'):x})")