Commit 67de8d58 authored by Miika Karanki's avatar Miika Karanki Committed by Carles Cufi
Browse files

scripts: logging: support native_posix dictionary logging



- Do not look CONFIG_* symbols from dynamic symbols which might
  be there before the symbol table where CONFIG_* symbols are found.

- Define posix architecture in ARCHS list.

- Check if architecture is not found instead of letting the code
  run into trying to access dictionary with None key.

Signed-off-by: default avatarMiika Karanki <miika.karanki@vaisala.com>
parent b292a9e8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ def find_elf_sections(elf, sh_name):
def get_kconfig_symbols(elf):
    """Get kconfig symbols from the ELF file"""
    for section in elf.iter_sections():
        if isinstance(section, SymbolTableSection):
        if isinstance(section, SymbolTableSection) and section['sh_type'] != 'SHT_DYNSYM':
            return {sym.name: sym.entry.st_value
                    for sym in section.iter_symbols()
                       if sym.name.startswith("CONFIG_")}
@@ -254,6 +254,9 @@ def process_kconfigs(elf, database):
        if arch['kconfig'] in kconfigs:
            database.set_arch(name)
            break
    else:
        logger.error("Did not found architecture")
        sys.exit(1)

    # Put some kconfigs into the database
    #
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ ARCHS = {
        # for explanation.
        "extra_string_section": ['datas'],
    },
    "posix" : {
        "kconfig": "CONFIG_ARCH_POSIX",
    },
    "riscv" : {
        "kconfig": "CONFIG_RISCV",
    },