From 90ebed4d33ea5465f41e5ca25b8873083d32de3d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 21 Jun 2012 20:54:53 -0400 Subject: [PATCH] Minor - ensure build can handle some gcc/linker section declarations. Make sure the build is not confused with some linker output common when using -flto. Signed-off-by: Kevin O'Connor --- tools/layoutrom.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/layoutrom.py b/tools/layoutrom.py index 7a7d08c..816ff9b 100755 --- a/tools/layoutrom.py +++ b/tools/layoutrom.py @@ -23,7 +23,7 @@ COMMONTRAILER = """ */ /DISCARD/ : { *(.text*) *(.data*) *(.bss*) *(.rodata*) - *(COMMON) *(.discard*) *(.eh_frame) + *(COMMON) *(.discard*) *(.eh_frame) *(.note*) } } """ @@ -556,7 +556,13 @@ def parseObjDump(file, fileid): continue if state == 'symbol': try: - sectionname, size, name = line[17:].split() + parts = line[17:].split() + if len(parts) == 3: + sectionname, size, name = parts + elif len(parts) == 4 and parts[2] == '.hidden': + sectionname, size, hidden, name = parts + else: + continue symbol = Symbol() symbol.size = int(size, 16) symbol.offset = int(line[:8], 16) -- 2.39.5