gen_kobject_list: fix on ARM targets

On ARM, a zero memory address actually falls within the expected bounds
of kernel memory.

Move the NULL check outside the bounds check, so that kernel objects
with NULL memory addresses in the DWARF info (because gc-sections
discarded them) won't confound the script's logic.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-10-11 12:22:40 -07:00 committed by Andrew Boie
commit 6093a94454

View file

@ -417,11 +417,12 @@ def find_kobjects(elf, syms):
addr = (loc.value[1] | (loc.value[2] << 8) | (loc.value[3] << 16) | addr = (loc.value[1] | (loc.value[2] << 8) | (loc.value[3] << 16) |
(loc.value[4] << 24)) (loc.value[4] << 24))
if addr == 0:
# Never linked; gc-sections deleted it
continue
if ((addr < kram_start or addr >= kram_end) if ((addr < kram_start or addr >= kram_end)
and (addr < krom_start or addr >= krom_end)): and (addr < krom_start or addr >= krom_end)):
if addr == 0:
# Never linked; gc-sections deleted it
continue
debug_die(die, "object '%s' found in invalid location %s" % debug_die(die, "object '%s' found in invalid location %s" %
(name, hex(addr))); (name, hex(addr)));