diff --git a/scripts/build/elf_parser.py b/scripts/build/elf_parser.py index 3dcc8534fe..bd7a970431 100644 --- a/scripts/build/elf_parser.py +++ b/scripts/build/elf_parser.py @@ -100,8 +100,11 @@ class Device(_Symbol): # Point to the handles instance associated with the device; # assigned by correlating the device struct handles pointer # value with the addr of a Handles instance. - ordinal_offset = self.elf.ld_consts['_DEVICE_STRUCT_HANDLES_OFFSET'] - self.obj_ordinals = self._data_native_read(ordinal_offset) + self.obj_ordinals = None + if '_DEVICE_STRUCT_HANDLES_OFFSET' in self.elf.ld_consts: + ordinal_offset = self.elf.ld_consts['_DEVICE_STRUCT_HANDLES_OFFSET'] + self.obj_ordinals = self._data_native_read(ordinal_offset) + self.obj_pm = None if '_DEVICE_STRUCT_PM_OFFSET' in self.elf.ld_consts: pm_offset = self.elf.ld_consts['_DEVICE_STRUCT_PM_OFFSET']