Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPU fault while trying to call symbol in LLEXT module #72957

Closed
joelguittet opened this issue May 17, 2024 · 6 comments
Closed

MPU fault while trying to call symbol in LLEXT module #72957

joelguittet opened this issue May 17, 2024 · 6 comments
Assignees
Labels
area: Linkable Loadable Extensions area: llext Linkable Loadable Extensions bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@joelguittet
Copy link
Contributor

Hello,

I'm working with nucleo_l4a6zg board from st.

I have build hello-world LLEXT example with the following command:

west build -d build-llext -b nucleo_l4a6zg tests/subsys/llext/simple/

and then retrieved hello-world.llext file in the build dir.

Then I have loaded the file on the board using the llext loader (not using the shell).

Then with the shell I would like to test it, so some simple commands on the uart interface:

uart:~$ llext list
| Name             | Size         |
|      hello-world |          949 |

Looks it's properly loaded 🎉

uart:~$ llext list_symbols hello-world 
Extension: hello-world symbols
| Symbol           | Address    |

Seems there is no symbol 😔

And finally:

uart:~$ llext call_fn hello-world test_entry
[00:00:58.481,000] <err> os: ***** MPU FAULT *****
[00:00:58.486,000] <err> os:   Instruction Access Violation
[00:00:58.493,000] <err> os: r0/a1:  0x20026241  r1/a2:  0x20004853  r2/a3:  0x00000000
[00:00:58.501,000] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0803dccf
[00:00:58.510,000] <err> os:  xpsr:  0x61000000
[00:00:58.515,000] <err> os: Faulting instruction address (r15/pc): 0x20026240
[00:00:58.523,000] <err> os: >>> ZEPHYR FATAL ERROR 20: Unknown error on CPU 0
[00:00:58.531,000] <err> os: Current thread: 0x200010c0 (shell_uart)
[00:00:58.538,000] <err> os: Halting system

What could be the reason the test_entry function is not available ??

I activated LLEXT debug log level and I have the following logs when the module is loaded in my application:

[00:00:27.445,000] <dbg> llext: llext_load: Loading relocatable or shared elf
[00:00:27.455,000] <dbg> llext: do_llext_load: Finding ELF tables...
[00:00:27.464,000] <dbg> llext: llext_find_tables: section 0 at 2c4: name 0, type 0, flags 0, addr 0, size 0
[00:00:27.476,000] <dbg> llext: llext_find_tables: section 1 at 2ec: name 31, type 1, flags 6, addr 0, size 36
[00:00:27.489,000] <dbg> llext: llext_find_tables: section 2 at 314: name 27, type 9, flags 40, addr 0, size 24
[00:00:27.502,000] <dbg> llext: llext_find_tables: section 3 at 33c: name 37, type 1, flags 3, addr 0, size 0
[00:00:27.514,000] <dbg> llext: llext_find_tables: section 4 at 364: name 43, type 8, flags 3, addr 0, size 0
[00:00:27.527,000] <dbg> llext: llext_find_tables: section 5 at 38c: name 48, type 1, flags 2, addr 0, size 47
[00:00:27.539,000] <dbg> llext: llext_find_tables: section 6 at 3b4: name 60, type 1, flags 2, addr 0, size 8
[00:00:27.552,000] <dbg> llext: llext_find_tables: section 7 at 3dc: name 56, type 9, flags 40, addr 0, size 16
[00:00:27.564,000] <dbg> llext: llext_find_tables: section 8 at 404: name 74, type 1, flags 30, addr 0, size 33
[00:00:27.577,000] <dbg> llext: llext_find_tables: section 9 at 42c: name 83, type 1879048195, flags 0, addr 0, size 48
[00:00:27.590,000] <dbg> llext: llext_find_tables: section 10 at 454: name 1, type 2, flags 0, addr 0, size 272
[00:00:27.603,000] <dbg> llext: llext_find_tables: symtab at 10
[00:00:27.612,000] <dbg> llext: llext_find_tables: section 11 at 47c: name 9, type 3, flags 0, addr 0, size 65
[00:00:27.624,000] <dbg> llext: llext_find_tables: strtab at 11
[00:00:27.633,000] <dbg> llext: llext_find_tables: section 12 at 4a4: name 17, type 3, flags 0, addr 0, size 99
[00:00:27.645,000] <dbg> llext: llext_find_tables: shstrtab at 12
[00:00:27.654,000] <dbg> llext: do_llext_load: Allocate and copy strings...
[00:00:27.664,000] <dbg> llext: do_llext_load: Mapping ELF sections...
[00:00:27.673,000] <dbg> llext: llext_map_sections: section 0 name 
[00:00:27.682,000] <dbg> llext: llext_map_sections: Not copied section 
[00:00:27.691,000] <dbg> llext: llext_map_sections: section 1 name .text
[00:00:27.700,000] <dbg> llext: llext_map_sections: section 2 name .rel.text
[00:00:27.710,000] <dbg> llext: llext_map_sections: Not copied section .rel.text
[00:00:27.720,000] <dbg> llext: llext_map_sections: section 3 name .data
[00:00:27.729,000] <dbg> llext: llext_map_sections: section 4 name .bss
[00:00:27.738,000] <dbg> llext: llext_map_sections: section 5 name .rodata
[00:00:27.748,000] <dbg> llext: llext_map_sections: section 6 name .exported_sym
[00:00:27.758,000] <dbg> llext: llext_map_sections: section 7 name .rel.exported_sym
[00:00:27.768,000] <dbg> llext: llext_map_sections: Not copied section .rel.exported_sym
[00:00:27.779,000] <dbg> llext: llext_map_sections: section 8 name .comment
[00:00:27.788,000] <dbg> llext: llext_map_sections: Not copied section .comment
[00:00:27.798,000] <dbg> llext: llext_map_sections: section 9 name .ARM.attributes
[00:00:27.808,000] <dbg> llext: llext_map_sections: Not copied section .ARM.attributes
[00:00:27.819,000] <dbg> llext: llext_map_sections: section 10 name .symtab
[00:00:27.828,000] <dbg> llext: llext_map_sections: Not copied section .symtab
[00:00:27.838,000] <dbg> llext: llext_map_sections: section 11 name .strtab
[00:00:27.848,000] <dbg> llext: llext_map_sections: Not copied section .strtab
[00:00:27.857,000] <dbg> llext: llext_map_sections: section 12 name .shstrtab
[00:00:27.867,000] <dbg> llext: llext_map_sections: Not copied section .shstrtab
[00:00:27.877,000] <dbg> llext: do_llext_load: Allocate and copy sections...
[00:00:27.887,000] <dbg> llext: do_llext_load: Counting exported symbols...
[00:00:27.896,000] <dbg> llext: llext_count_export_syms: symbol count 17
[00:00:27.906,000] <dbg> llext: llext_count_export_syms: unhandled symbol 1, name hello_world_ext.c, type tag 4, bind 0, sect 65521
[00:00:27.920,000] <dbg> llext: llext_count_export_syms: unhandled symbol 2, name , type tag 3, bind 0, sect 1
[00:00:27.933,000] <dbg> llext: llext_count_export_syms: unhandled symbol 3, name , type tag 3, bind 0, sect 3
[00:00:27.945,000] <dbg> llext: llext_count_export_syms: unhandled symbol 4, name , type tag 3, bind 0, sect 4
[00:00:27.958,000] <dbg> llext: llext_count_export_syms: unhandled symbol 5, name , type tag 3, bind 0, sect 5
[00:00:27.970,000] <dbg> llext: llext_count_export_syms: unhandled symbol 6, name $d, type tag 0, bind 0, sect 5
[00:00:27.983,000] <dbg> llext: llext_count_export_syms: unhandled symbol 7, name number, type tag 1, bind 0, sect 5
[00:00:27.996,000] <dbg> llext: llext_count_export_syms: unhandled symbol 8, name $t, type tag 0, bind 0, sect 1
[00:00:28.009,000] <dbg> llext: llext_count_export_syms: unhandled symbol 9, name $d, type tag 0, bind 0, sect 1
[00:00:28.022,000] <dbg> llext: llext_count_export_syms: unhandled symbol 10, name , type tag 3, bind 0, sect 6
[00:00:28.034,000] <dbg> llext: llext_count_export_syms: unhandled symbol 11, name $d, type tag 0, bind 0, sect 6
[00:00:28.047,000] <dbg> llext: llext_count_export_syms: unhandled symbol 12, name test_entry_sym, type tag 1, bind 0, sect 6
[00:00:28.061,000] <dbg> llext: llext_count_export_syms: unhandled symbol 13, name , type tag 3, bind 0, sect 8
[00:00:28.074,000] <dbg> llext: llext_count_export_syms: unhandled symbol 14, name , type tag 3, bind 0, sect 9
[00:00:28.087,000] <dbg> llext: llext_count_export_syms: function symbol 15, name test_entry, type tag 2, bind 1, sect 1
[00:00:28.100,000] <dbg> llext: llext_count_export_syms: unhandled symbol 16, name printk, type tag 0, bind 1, sect 0
[00:00:28.113,000] <dbg> llext: do_llext_load: Allocating memory for symbol table...
[00:00:28.124,000] <dbg> llext: do_llext_load: Copying symbols...
[00:00:28.132,000] <dbg> llext: llext_copy_symbols: function symbol 0 name test_entry addr 0x20026241
[00:00:28.144,000] <dbg> llext: do_llext_load: Linking ELF...
[00:00:28.152,000] <dbg> llext: llext_link: relocation section .rel.text (2) linked to section 10 has 3 relocations
[00:00:28.165,000] <dbg> llext: llext_link: relocation 2:0 info 502 (type 2, sym 5) offset 24 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
[00:00:28.180,000] <inf> llext: found section symbol  addr 0x200262c0
[00:00:28.189,000] <inf> llext: writing relocation symbol  type 2 sym 5 at addr 0x20026258 addr 0x200262c0
[00:00:28.201,000] <dbg> elf: arch_elf_relocate: 2 20026258 200262c0 
[00:00:28.210,000] <dbg> llext: llext_link: relocation 2:1 info 1002 (type 2, sym 16) offset 28 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
[00:00:28.226,000] <inf> llext: found symbol printk at 0x803bf39
[00:00:28.234,000] <inf> llext: writing relocation symbol printk type 2 sym 16 at addr 0x2002625c addr 0x803bf39
[00:00:28.247,000] <dbg> elf: arch_elf_relocate: 2 2002625c 803bf39 printk
[00:00:28.257,000] <dbg> llext: llext_link: relocation 2:2 info 502 (type 2, sym 5) offset 32 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
[00:00:28.271,000] <inf> llext: found section symbol  addr 0x200262c0
[00:00:28.280,000] <inf> llext: writing relocation symbol  type 2 sym 5 at addr 0x20026260 addr 0x200262c0
[00:00:28.293,000] <dbg> elf: arch_elf_relocate: 2 20026260 200262c0 
[00:00:28.302,000] <dbg> llext: llext_link: relocation section .rel.exported_sym (7) linked to section 10 has 2 relocations
[00:00:28.315,000] <dbg> llext: llext_link: relocation 7:0 info 502 (type 2, sym 5) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
[00:00:28.330,000] <inf> llext: found section symbol  addr 0x200262c0
[00:00:28.339,000] <inf> llext: writing relocation symbol  type 2 sym 5 at addr 0x20026120 addr 0x200262c0
[00:00:28.351,000] <dbg> elf: arch_elf_relocate: 2 20026120 200262c0 
[00:00:28.360,000] <dbg> llext: llext_link: relocation 7:1 info f02 (type 2, sym 15) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
[00:00:28.376,000] <inf> llext: found section symbol test_entry addr 0x20026241
[00:00:28.386,000] <inf> llext: writing relocation symbol test_entry type 2 sym 15 at addr 0x20026124 addr 0x20026241
[00:00:28.399,000] <dbg> elf: arch_elf_relocate: 2 20026124 20026241 test_entry
[00:00:28.409,000] <dbg> llext: llext_export_symbols: sym 0x20026241 name test_entry in 0x2002604c
[00:00:28.421,000] <dbg> llext: do_llext_load: loaded module, .text at 0x20026240, .rodata at 0x200262c0
[00:00:28.433,000] <inf> llext: Loaded extension hello-world

This looks good and we can see the test_entrysymbol is properly read.

I'm on top of the main branch + 1 modification to get the LLEXT shell building properly (looks strange nobody is reporting this isn't it ? I can do a PR):

diff --git a/subsys/llext/CMakeLists.txt b/subsys/llext/CMakeLists.txt
index b129dc7f943..68a9e83df08 100644
--- a/subsys/llext/CMakeLists.txt
+++ b/subsys/llext/CMakeLists.txt
@@ -1,5 +1,6 @@
 if(CONFIG_LLEXT)
   zephyr_library()
+  zephyr_library_compile_definitions(-D_POSIX_C_SOURCE=200809L)
   zephyr_library_sources(llext.c llext_export.c buf_loader.c)
   zephyr_library_sources_ifdef(CONFIG_LLEXT_SHELL shell.c)
 endif()

So at the end several questions:

  • what is the proper way to build an LLEXT module ? I didn't find information in the docs.
  • Why test_entry symbol is not found ? Could it be related to my platform ? I tested with CONFIG_ARM_MPU=n after discussion on discord, same result.
  • What about the modification I had to do to build the LLEXT shell ?

Thanks for any advice!

@joelguittet joelguittet added the bug The issue is a bug, or the PR is fixing a bug label May 17, 2024
@henrikbrixandersen henrikbrixandersen added the area: llext Linkable Loadable Extensions label May 18, 2024
@joelguittet
Copy link
Contributor Author

Additional informations.

In my code after loading the module with llext_load, I added the following:

void (*test_entry_fn)() = llext_find_sym(&ext->exp_tab, "test_entry");
LOG_INF("test_entry_fn='%p'", test_entry_fn);
if (NULL != test_entry_fn) {
    LOG_INF("calling test entry");
    test_entry_fn();
    LOG_INF("called ok");
}

Result is the following:

[00:00:28.434,000] <inf> mender_stm32l4a6_zephyr_example: test_entry_fn='0x20026241'
[00:00:28.445,000] <inf> mender_stm32l4a6_zephyr_example: calling test entry
[00:00:28.454,000] <err> os: ***** MPU FAULT *****
[00:00:28.462,000] <err> os:   Instruction Access Violation
[00:00:28.470,000] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000005  r2/a3:  0x20004248
[00:00:28.481,000] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0800f97b
[00:00:28.492,000] <err> os:  xpsr:  0x010e0000
[00:00:28.499,000] <err> os: Faulting instruction address (r15/pc): 0x20026240
[00:00:28.510,000] <err> os: >>> ZEPHYR FATAL ERROR 20: Unknown error on CPU 0
[00:00:28.520,000] <err> os: Current thread: 0x20004248 (mender_rtos_work_queue)
[00:00:28.530,000] <err> os: Halting system

So the function is found but execution failed as seen previously in the shell.

Also done some basics, but not sure it helps:

(.venv) ubuntu@ubuntu-VirtualBox:~/zephyrproject/zephyr$ objdump -s build-llext/zephyr/hello_world.llext 

build-llext/zephyr/hello_world.llext:     file format elf32-little

Contents of section .text:
 0000 80b500af 0448054b 98472a23 19460448  .....H.K.G*#.F.H
 0010 024b9847 00bf80bd 04000000 00000000  .K.G............
 0020 14000000                             ....            
Contents of section .rodata:
 0000 2a000000 68656c6c 6f20776f 726c640a  *...hello world.
 0010 00000000 41206e75 6d626572 20697320  ....A number is 
 0020 25750a00 74657374 5f656e74 727900    %u..test_entry. 
Contents of section .exported_sym:
 0000 24000000 00000000                    $.......        
Contents of section .comment:
 0000 00474343 3a20285a 65706879 72205344  .GCC: (Zephyr SD
 0010 4b20302e 31362e31 29203132 2e322e30  K 0.16.1) 12.2.0
 0020 00                                   .               
Contents of section .ARM.attributes:
 0000 412f0000 00616561 62690001 25000000  A/...aeabi..%...
 0010 0537452d 4d00060d 074d0902 12041401  .7E-M....M......
 0020 15011703 18011901 1a011e06 22012601  ............".&.
(.venv) ubuntu@ubuntu-VirtualBox:~/zephyrproject/zephyr$ readelf -a build-llext/zephyr/hello_world.llext
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          708 (bytes into file)
  Flags:                             0x5000000, Version5 EABI
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 12

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000034 000024 00  AX  0   0  4
  [ 2] .rel.text         REL             00000000 000238 000018 08   I 10   1  4
  [ 3] .data             PROGBITS        00000000 000058 000000 00  WA  0   0  1
  [ 4] .bss              NOBITS          00000000 000058 000000 00  WA  0   0  1
  [ 5] .rodata           PROGBITS        00000000 000058 00002f 00   A  0   0  4
  [ 6] .exported_sym     PROGBITS        00000000 000088 000008 00   A  0   0  4
  [ 7] .rel.exported_sym REL             00000000 000250 000010 08   I 10   6  4
  [ 8] .comment          PROGBITS        00000000 000090 000021 01  MS  0   0  1
  [ 9] .ARM.attributes   ARM_ATTRIBUTES  00000000 0000b1 000030 00      0   0  1
  [10] .symtab           SYMTAB          00000000 0000e4 000110 10     11  15  4
  [11] .strtab           STRTAB          00000000 0001f4 000041 00      0   0  1
  [12] .shstrtab         STRTAB          00000000 000260 000063 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  y (purecode), p (processor specific)

There are no section groups in this file.

There are no program headers in this file.

There is no dynamic section in this file.

Relocation section '.rel.text' at offset 0x238 contains 3 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
00000018  00000502 R_ARM_ABS32       00000000   .rodata
0000001c  00001002 R_ARM_ABS32       00000000   printk
00000020  00000502 R_ARM_ABS32       00000000   .rodata

Relocation section '.rel.exported_sym' at offset 0x250 contains 2 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
00000000  00000502 R_ARM_ABS32       00000000   .rodata
00000004  00000f02 R_ARM_ABS32       00000001   test_entry

There are no unwind sections in this file.

Symbol table '.symtab' contains 17 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS hello_world_ext.c
     2: 00000000     0 SECTION LOCAL  DEFAULT    1 
     3: 00000000     0 SECTION LOCAL  DEFAULT    3 
     4: 00000000     0 SECTION LOCAL  DEFAULT    4 
     5: 00000000     0 SECTION LOCAL  DEFAULT    5 
     6: 00000000     0 NOTYPE  LOCAL  DEFAULT    5 $d
     7: 00000000     4 OBJECT  LOCAL  DEFAULT    5 number
     8: 00000000     0 NOTYPE  LOCAL  DEFAULT    1 $t
     9: 00000018     0 NOTYPE  LOCAL  DEFAULT    1 $d
    10: 00000000     0 SECTION LOCAL  DEFAULT    6 
    11: 00000000     0 NOTYPE  LOCAL  DEFAULT    6 $d
    12: 00000000     8 OBJECT  LOCAL  DEFAULT    6 test_entry_sym
    13: 00000000     0 SECTION LOCAL  DEFAULT    8 
    14: 00000000     0 SECTION LOCAL  DEFAULT    9 
    15: 00000001    36 FUNC    GLOBAL DEFAULT    1 test_entry
    16: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND printk

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7E-M"
  Tag_CPU_arch: v7E-M
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: small
  Tag_ABI_optimization_goals: Aggressive Debug
  Tag_CPU_unaligned_access: v6
  Tag_ABI_FP_16bit_format: IEEE 754

I also executed tests/subsys/llext/simple application directly on my board. It runs fine!

uart:~$ *** Booting Zephyr OS build v3.6.0-4148-gd49a28952e9a ***
Running TESTSUITE llext
===================================================================
START - test_ext_syscall_fail
 PASS - test_ext_syscall_fail in 0.001 seconds
===================================================================
START - test_load_unload_hello_world
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 2c4: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 2ec: name 31, type 1, flags 6, addr 0, size 36
D: section 2 at 314: name 27, type 9, flags 40, addr 0, size 24
D: section 3 at 33c: name 37, type 1, flags 3, addr 0, size 0
D: section 4 at 364: name 43, type 8, flags 3, addr 0, size 0
D: section 5 at 38c: name 48, type 1, flags 2, addr 0, size 47
D: section 6 at 3b4: name 60, type 1, flags 2, addr 0, size 8
D: section 7 at 3dc: name 56, type 9, flags 40, addr 0, size 16
D: section 8 at 404: name 74, type 1, flags 30, addr 0, size 33
D: section 9 at 42c: name 83, type 1879048195, flags 0, addr 0, size 48
D: section 10 at 454: name 1, type 2, flags 0, addr 0, size 272
D: symtab at 10
D: section 11 at 47c: name 9, type 3, flags 0, addr 0, size 65
D: strtab at 11
D: section 12 at 4a4: name 17, type 3, flags 0, addr 0, size 99
D: shstrtab at 12
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .bss
D: section 5 name .rodata
D: section 6 name .exported_sym
D: section 7 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 8 name .comment
D: Not copied section .comment
D: section 9 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 10 name .symtab
D: Not copied section .symtab
D: section 11 name .strtab
D: Not copied section .strtab
D: section 12 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 17
D: unhandled symbol 1, name hello_world_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 4
D: unhandled symbol 5, name , type tag 3, bind 0, sect 5
D: unhandled symbol 6, name $d, type tag 0, bind 0, sect 5
D: unhandled symbol 7, name number, type tag 1, bind 0, sect 5
D: unhandled symbol 8, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 9, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 10, name , type tag 3, bind 0, sect 6
D: unhandled symbol 11, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 12, name test_entry_sym, type tag 1, bind 0, sect 6
D: unhandled symbol 13, name , type tag 3, bind 0, sect 8
D: unhandled symbol 14, name , type tag 3, bind 0, sect 9
D: function symbol 15, name test_entry, type tag 2, bind 1, sect 1
D: unhandled symbol 16, name printk, type tag 0, bind 1, sect 0
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name test_entry addr 0x20001ce1
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 10 has 3 relocations
D: relocation 2:0 info 502 (type 2, sym 5) offset 24 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001d40
I: writing relocation symbol  type 2 sym 5 at addr 0x20001cf8 addr 0x20001d40
D: 2 20001cf8 20001d40 
D: relocation 2:1 info 1002 (type 2, sym 16) offset 28 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 16 at addr 0x20001cfc addr 0x8009129
D: 2 20001cfc 8009129 printk
D: relocation 2:2 info 502 (type 2, sym 5) offset 32 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001d40
I: writing relocation symbol  type 2 sym 5 at addr 0x20001d00 addr 0x20001d40
D: 2 20001d00 20001d40 
D: relocation section .rel.exported_sym (7) linked to section 10 has 2 relocations
D: relocation 7:0 info 502 (type 2, sym 5) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001d40
I: writing relocation symbol  type 2 sym 5 at addr 0x20001da0 addr 0x20001d40
D: 2 20001da0 20001d40 
D: relocation 7:1 info f02 (type 2, sym 15) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001ce1
I: writing relocation symbol test_entry type 2 sym 15 at addr 0x20001da4 addr 0x20001ce1
D: 2 20001da4 20001ce1 test_entry
D: sym 0x20001ce1 name test_entry in 0x20001cc4
D: loaded module, .text at 0x20001ce0, .rodata at 0x20001d40
I: Loaded extension hello_world
hello world
A number is 42
D: freeing memory region 0
D: freeing memory region 2
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_hello_world in 0.403 seconds
===================================================================
START - test_load_unload_logging
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 4e4: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 50c: name 31, type 1, flags 6, addr 0, size 144
D: section 2 at 534: name 27, type 9, flags 40, addr 0, size 56
D: section 3 at 55c: name 41, type 1, flags 3, addr 0, size 4
D: section 4 at 584: name 37, type 9, flags 40, addr 0, size 8
D: section 5 at 5ac: name 47, type 8, flags 3, addr 0, size 4
D: section 6 at 5d4: name 52, type 1, flags 2, addr 0, size 71
D: section 7 at 5fc: name 64, type 1, flags 2, addr 0, size 8
D: section 8 at 624: name 60, type 9, flags 40, addr 0, size 8
D: section 9 at 64c: name 110, type 1, flags 2, addr 0, size 8
D: section 10 at 674: name 106, type 9, flags 40, addr 0, size 16
D: section 11 at 69c: name 124, type 1, flags 30, addr 0, size 33
D: section 12 at 6c4: name 133, type 1879048195, flags 0, addr 0, size 48
D: section 13 at 6ec: name 1, type 2, flags 0, addr 0, size 448
D: symtab at 13
D: section 14 at 714: name 9, type 3, flags 0, addr 0, size 189
D: strtab at 14
D: section 15 at 73c: name 17, type 3, flags 0, addr 0, size 149
D: shstrtab at 15
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .rel.data
D: Not copied section .rel.data
D: section 5 name .bss
D: section 6 name .rodata
D: section 7 name ._log_const.static.log_const_logging_ext_
D: Not copied section ._log_const.static.log_const_logging_ext_
D: section 8 name .rel._log_const.static.log_const_logging_ext_
D: Not copied section .rel._log_const.static.log_const_logging_ext_
D: section 9 name .exported_sym
D: section 10 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 11 name .comment
D: Not copied section .comment
D: section 12 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 13 name .symtab
D: Not copied section .symtab
D: section 14 name .strtab
D: Not copied section .strtab
D: section 15 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 28
D: unhandled symbol 1, name logging_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 5
D: unhandled symbol 5, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 6, name z_log_minimal_level_to_char, type tag 2, bind 0, sect 1
D: unhandled symbol 7, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 8, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 9, name , type tag 3, bind 0, sect 6
D: unhandled symbol 10, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 11, name , type tag 3, bind 0, sect 7
D: unhandled symbol 12, name $d, type tag 0, bind 0, sect 7
D: unhandled symbol 13, name $d, type tag 0, bind 0, sect 3
D: unhandled symbol 14, name __log_current_const_data, type tag 1, bind 0, sect 3
D: unhandled symbol 15, name $d, type tag 0, bind 0, sect 5
D: unhandled symbol 16, name __log_current_dynamic_data, type tag 0, bind 0, sect 5
D: unhandled symbol 17, name __log_level, type tag 1, bind 0, sect 6
D: unhandled symbol 18, name number, type tag 1, bind 0, sect 6
D: unhandled symbol 19, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 20, name , type tag 3, bind 0, sect 9
D: unhandled symbol 21, name $d, type tag 0, bind 0, sect 9
D: unhandled symbol 22, name test_entry_sym, type tag 1, bind 0, sect 9
D: unhandled symbol 23, name , type tag 3, bind 0, sect 11
D: unhandled symbol 24, name , type tag 3, bind 0, sect 12
D: function symbol 25, name log_const_logging_ext, type tag 1, bind 1, sect 7
D: function symbol 26, name test_entry, type tag 2, bind 1, sect 1
D: unhandled symbol 27, name z_log_minimal_printk, type tag 0, bind 1, sect 0
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name log_const_logging_ext addr 0x20001d60
D: function symbol 1 name test_entry addr 0x20001da5
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 13 has 7 relocations
D: relocation 2:0 info 202 (type 2, sym 2) offset 24 sym_name  sym_type 3 sym_bind 0 sym_ndx 1
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 2 at addr 0x20001d78 addr 0x20001d60
D: 2 20001d78 20001d60 
D: relocation 2:1 info 202 (type 2, sym 2) offset 28 sym_name  sym_type 3 sym_bind 0 sym_ndx 1
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 2 at addr 0x20001d7c addr 0x20001d60
D: 2 20001d7c 20001d60 
D: relocation 2:2 info 202 (type 2, sym 2) offset 32 sym_name  sym_type 3 sym_bind 0 sym_ndx 1
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 2 at addr 0x20001d80 addr 0x20001d60
D: 2 20001d80 20001d60 
D: relocation 2:3 info 202 (type 2, sym 2) offset 36 sym_name  sym_type 3 sym_bind 0 sym_ndx 1
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 2 at addr 0x20001d84 addr 0x20001d60
D: 2 20001d84 20001d60 
D: relocation 2:4 info 902 (type 2, sym 9) offset 132 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001e60
I: writing relocation symbol  type 2 sym 9 at addr 0x20001de4 addr 0x20001e60
D: 2 20001de4 20001e60 
D: relocation 2:5 info 1b02 (type 2, sym 27) offset 136 sym_name z_log_minimal_printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_log_minimal_printk at 0x8009171
I: writing relocation symbol z_log_minimal_printk type 2 sym 27 at addr 0x20001de8 addr 0x8009171
D: 2 20001de8 8009171 z_log_minimal_printk
D: relocation 2:6 info 902 (type 2, sym 9) offset 140 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001e60
I: writing relocation symbol  type 2 sym 9 at addr 0x20001dec addr 0x20001e60
D: 2 20001dec 20001e60 
D: relocation section .rel.data (4) linked to section 13 has 1 relocations
D: relocation 4:0 info 1902 (type 2, sym 25) offset 0 sym_name log_const_logging_ext sym_type 1 sym_bind 1 sym_ndx 7
I: found section symbol log_const_logging_ext addr 0x20001d60
I: writing relocation symbol log_const_logging_ext type 2 sym 25 at addr 0x20001e20 addr 0x20001d60
D: 2 20001e20 20001d60 log_const_logging_ext
D: relocation section .rel._log_const.static.log_const_logging_ext_ (8) linked to section 13 has 1 relocations
D: relocation 8:0 info 902 (type 2, sym 9) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001e60
I: writing relocation symbol  type 2 sym 9 at addr 0x20001e20 addr 0x20001e60
D: 2 20001e20 20001e60 
D: relocation section .rel.exported_sym (10) linked to section 13 has 2 relocations
D: relocation 10:0 info 902 (type 2, sym 9) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001e60
I: writing relocation symbol  type 2 sym 9 at addr 0x20001f20 addr 0x20001e60
D: 2 20001f20 20001e60 
D: relocation 10:1 info 1a02 (type 2, sym 26) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001da5
I: writing relocation symbol test_entry type 2 sym 26 at addr 0x20001f24 addr 0x20001da5
D: 2 20001f24 20001da5 test_entry
D: sym 0x20001da5 name test_entry in 0x20001d44
D: loaded module, .text at 0x20001d60, .rodata at 0x20001e60
I: Loaded extension logging
I: hello world
I: A number is 42
D: freeing memory region 0
D: freeing memory region 1
D: freeing memory region 2
D: freeing memory region 3
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_logging in 0.683 seconds
===================================================================
START - test_load_unload_object
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 34c: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 374: name 31, type 1, flags 6, addr 0, size 76
D: section 2 at 39c: name 27, type 9, flags 40, addr 0, size 48
D: section 3 at 3c4: name 41, type 1, flags 3, addr 0, size 8
D: section 4 at 3ec: name 37, type 9, flags 40, addr 0, size 8
D: section 5 at 414: name 47, type 8, flags 3, addr 0, size 0
D: section 6 at 43c: name 52, type 1, flags 2, addr 0, size 67
D: section 7 at 464: name 64, type 1, flags 2, addr 0, size 8
D: section 8 at 48c: name 60, type 9, flags 40, addr 0, size 16
D: section 9 at 4b4: name 78, type 1, flags 30, addr 0, size 33
D: section 10 at 4dc: name 87, type 1879048195, flags 0, addr 0, size 48
D: section 11 at 504: name 1, type 2, flags 0, addr 0, size 304
D: symtab at 11
D: section 12 at 52c: name 9, type 3, flags 0, addr 0, size 67
D: strtab at 12
D: section 13 at 554: name 17, type 3, flags 0, addr 0, size 103
D: shstrtab at 13
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .rel.data
D: Not copied section .rel.data
D: section 5 name .bss
D: section 6 name .rodata
D: section 7 name .exported_sym
D: section 8 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 9 name .comment
D: Not copied section .comment
D: section 10 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 11 name .symtab
D: Not copied section .symtab
D: section 12 name .strtab
D: Not copied section .strtab
D: section 13 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 19
D: unhandled symbol 1, name object_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 5
D: unhandled symbol 5, name $d, type tag 0, bind 0, sect 3
D: unhandled symbol 6, name , type tag 3, bind 0, sect 6
D: unhandled symbol 7, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 8, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 9, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 10, name , type tag 3, bind 0, sect 7
D: unhandled symbol 11, name $d, type tag 0, bind 0, sect 7
D: unhandled symbol 12, name test_entry_sym, type tag 1, bind 0, sect 7
D: unhandled symbol 13, name , type tag 3, bind 0, sect 9
D: unhandled symbol 14, name , type tag 3, bind 0, sect 10
D: function symbol 15, name number, type tag 1, bind 1, sect 3
D: function symbol 16, name string, type tag 1, bind 1, sect 3
D: function symbol 17, name test_entry, type tag 2, bind 1, sect 1
D: unhandled symbol 18, name printk, type tag 0, bind 1, sect 0
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name number addr 0x20001d60
D: function symbol 1 name string addr 0x20001d64
D: function symbol 2 name test_entry addr 0x20001ce1
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 11 has 6 relocations
D: relocation 2:0 info f02 (type 2, sym 15) offset 52 sym_name number sym_type 1 sym_bind 1 sym_ndx 3
I: found section symbol number addr 0x20001d60
I: writing relocation symbol number type 2 sym 15 at addr 0x20001d14 addr 0x20001d60
D: 2 20001d14 20001d60 number
D: relocation 2:1 info 602 (type 2, sym 6) offset 56 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001da0
I: writing relocation symbol  type 2 sym 6 at addr 0x20001d18 addr 0x20001da0
D: 2 20001d18 20001da0 
D: relocation 2:2 info 1202 (type 2, sym 18) offset 60 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 18 at addr 0x20001d1c addr 0x8009129
D: 2 20001d1c 8009129 printk
D: relocation 2:3 info 602 (type 2, sym 6) offset 64 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001da0
I: writing relocation symbol  type 2 sym 6 at addr 0x20001d20 addr 0x20001da0
D: 2 20001d20 20001da0 
D: relocation 2:4 info 1002 (type 2, sym 16) offset 68 sym_name string sym_type 1 sym_bind 1 sym_ndx 3
I: found section symbol string addr 0x20001d64
I: writing relocation symbol string type 2 sym 16 at addr 0x20001d24 addr 0x20001d64
D: 2 20001d24 20001d64 string
D: relocation 2:5 info 602 (type 2, sym 6) offset 72 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001da0
I: writing relocation symbol  type 2 sym 6 at addr 0x20001d28 addr 0x20001da0
D: 2 20001d28 20001da0 
D: relocation section .rel.data (4) linked to section 11 has 1 relocations
D: relocation 4:0 info 602 (type 2, sym 6) offset 4 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001da0
I: writing relocation symbol  type 2 sym 6 at addr 0x20001d64 addr 0x20001da0
D: 2 20001d64 20001da0 
D: relocation section .rel.exported_sym (8) linked to section 11 has 2 relocations
D: relocation 8:0 info 602 (type 2, sym 6) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 6
I: found section symbol  addr 0x20001da0
I: writing relocation symbol  type 2 sym 6 at addr 0x20001e20 addr 0x20001da0
D: 2 20001e20 20001da0 
D: relocation 8:1 info 1102 (type 2, sym 17) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001ce1
I: writing relocation symbol test_entry type 2 sym 17 at addr 0x20001e24 addr 0x20001ce1
D: 2 20001e24 20001ce1 test_entry
D: sym 0x20001ce1 name test_entry in 0x20001c44
D: loaded module, .text at 0x20001ce0, .rodata at 0x20001da0
I: Loaded extension object
number: 42
number, updated: 0
string: hello
D: freeing memory region 0
D: freeing memory region 1
D: freeing memory region 2
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_object in 0.532 seconds
===================================================================
START - test_load_unload_relative_jump
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 558: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 580: name 31, type 1, flags 6, addr 0, size 172
D: section 2 at 5a8: name 27, type 9, flags 40, addr 0, size 144
D: section 3 at 5d0: name 37, type 1, flags 3, addr 0, size 0
D: section 4 at 5f8: name 43, type 8, flags 3, addr 0, size 0
D: section 5 at 620: name 48, type 1, flags 2, addr 0, size 127
D: section 6 at 648: name 60, type 1, flags 2, addr 0, size 8
D: section 7 at 670: name 56, type 9, flags 40, addr 0, size 16
D: section 8 at 698: name 74, type 1, flags 30, addr 0, size 33
D: section 9 at 6c0: name 83, type 1879048195, flags 0, addr 0, size 48
D: section 10 at 6e8: name 1, type 2, flags 0, addr 0, size 496
D: symtab at 10
D: section 11 at 710: name 9, type 3, flags 0, addr 0, size 165
D: strtab at 11
D: section 12 at 738: name 17, type 3, flags 0, addr 0, size 99
D: shstrtab at 12
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .bss
D: section 5 name .rodata
D: section 6 name .exported_sym
D: section 7 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 8 name .comment
D: Not copied section .comment
D: section 9 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 10 name .symtab
D: Not copied section .symtab
D: section 11 name .strtab
D: Not copied section .strtab
D: section 12 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 31
D: unhandled symbol 1, name relative_jump_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 4
D: unhandled symbol 5, name , type tag 3, bind 0, sect 5
D: unhandled symbol 6, name $d, type tag 0, bind 0, sect 5
D: unhandled symbol 7, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 8, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 9, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 10, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 11, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 12, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 13, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 14, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 15, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 16, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 17, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 18, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 19, name , type tag 3, bind 0, sect 6
D: unhandled symbol 20, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 21, name test_entry_sym, type tag 1, bind 0, sect 6
D: unhandled symbol 22, name , type tag 3, bind 0, sect 8
D: unhandled symbol 23, name , type tag 3, bind 0, sect 9
D: function symbol 24, name test_relative_jump_5, type tag 2, bind 1, sect 1
D: unhandled symbol 25, name printk, type tag 0, bind 1, sect 0
D: function symbol 26, name test_relative_jump_4, type tag 2, bind 1, sect 1
D: function symbol 27, name test_relative_jump_2, type tag 2, bind 1, sect 1
D: function symbol 28, name test_relative_jump_3, type tag 2, bind 1, sect 1
D: function symbol 29, name test_relative_jump_1, type tag 2, bind 1, sect 1
D: function symbol 30, name test_entry, type tag 2, bind 1, sect 1
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name test_relative_jump_5 addr 0x20001d41
D: function symbol 1 name test_relative_jump_4 addr 0x20001d59
D: function symbol 2 name test_relative_jump_2 addr 0x20001d75
D: function symbol 3 name test_relative_jump_3 addr 0x20001dad
D: function symbol 4 name test_relative_jump_1 addr 0x20001d91
D: function symbol 5 name test_entry addr 0x20001dc9
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 10 has 18 relocations
D: relocation 2:0 info 502 (type 2, sym 5) offset 16 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001d50 addr 0x20001e20
D: 2 20001d50 20001e20 
D: relocation 2:1 info 1902 (type 2, sym 25) offset 20 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001d54 addr 0x8009129
D: 2 20001d54 8009129 printk
D: relocation 2:2 info 180a (type 10, sym 24) offset 34 sym_name test_relative_jump_5 sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_relative_jump_5 addr 0x20001d41
I: writing relocation symbol test_relative_jump_5 type 10 sym 24 at addr 0x20001d62 addr 0x20001d41
D: 10 20001d62 20001d41 test_relative_jump_5
D: relocation 2:3 info 502 (type 2, sym 5) offset 44 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001d6c addr 0x20001e20
D: 2 20001d6c 20001e20 
D: relocation 2:4 info 1902 (type 2, sym 25) offset 48 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001d70 addr 0x8009129
D: 2 20001d70 8009129 printk
D: relocation 2:5 info 1c0a (type 10, sym 28) offset 62 sym_name test_relative_jump_3 sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_relative_jump_3 addr 0x20001dad
I: writing relocation symbol test_relative_jump_3 type 10 sym 28 at addr 0x20001d7e addr 0x20001dad
D: 10 20001d7e 20001dad test_relative_jump_3
D: relocation 2:6 info 502 (type 2, sym 5) offset 72 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001d88 addr 0x20001e20
D: 2 20001d88 20001e20 
D: relocation 2:7 info 1902 (type 2, sym 25) offset 76 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001d8c addr 0x8009129
D: 2 20001d8c 8009129 printk
D: relocation 2:8 info 1b0a (type 10, sym 27) offset 90 sym_name test_relative_jump_2 sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_relative_jump_2 addr 0x20001d75
I: writing relocation symbol test_relative_jump_2 type 10 sym 27 at addr 0x20001d9a addr 0x20001d75
D: 10 20001d9a 20001d75 test_relative_jump_2
D: relocation 2:9 info 502 (type 2, sym 5) offset 100 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001da4 addr 0x20001e20
D: 2 20001da4 20001e20 
D: relocation 2:10 info 1902 (type 2, sym 25) offset 104 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001da8 addr 0x8009129
D: 2 20001da8 8009129 printk
D: relocation 2:11 info 1a0a (type 10, sym 26) offset 118 sym_name test_relative_jump_4 sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_relative_jump_4 addr 0x20001d59
I: writing relocation symbol test_relative_jump_4 type 10 sym 26 at addr 0x20001db6 addr 0x20001d59
D: 10 20001db6 20001d59 test_relative_jump_4
D: relocation 2:12 info 502 (type 2, sym 5) offset 128 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001dc0 addr 0x20001e20
D: 2 20001dc0 20001e20 
D: relocation 2:13 info 1902 (type 2, sym 25) offset 132 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001dc4 addr 0x8009129
D: 2 20001dc4 8009129 printk
D: relocation 2:14 info 1d0a (type 10, sym 29) offset 146 sym_name test_relative_jump_1 sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_relative_jump_1 addr 0x20001d91
I: writing relocation symbol test_relative_jump_1 type 10 sym 29 at addr 0x20001dd2 addr 0x20001d91
D: 10 20001dd2 20001d91 test_relative_jump_1
D: relocation 2:15 info 502 (type 2, sym 5) offset 160 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001de0 addr 0x20001e20
D: 2 20001de0 20001e20 
D: relocation 2:16 info 1902 (type 2, sym 25) offset 164 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 25 at addr 0x20001de4 addr 0x8009129
D: 2 20001de4 8009129 printk
D: relocation 2:17 info 502 (type 2, sym 5) offset 168 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001de8 addr 0x20001e20
D: 2 20001de8 20001e20 
D: relocation section .rel.exported_sym (7) linked to section 10 has 2 relocations
D: relocation 7:0 info 502 (type 2, sym 5) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001e20
I: writing relocation symbol  type 2 sym 5 at addr 0x20001ec0 addr 0x20001e20
D: 2 20001ec0 20001e20 
D: relocation 7:1 info 1e02 (type 2, sym 30) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001dc9
I: writing relocation symbol test_entry type 2 sym 30 at addr 0x20001ec4 addr 0x20001dc9
D: 2 20001ec4 20001dc9 test_entry
D: sym 0x20001dc9 name test_entry in 0x20001c44
D: loaded module, .text at 0x20001d40, .rodata at 0x20001e20
I: Loaded extension relative_jump
enter
relative jump 1
relative jump 2
relative jump 3
relative jump 4
relative jump 5
exit
D: freeing memory region 0
D: freeing memory region 2
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_relative_jump in 0.879 seconds
===================================================================
START - test_load_unload_syscalls
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 338: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 360: name 31, type 1, flags 6, addr 0, size 76
D: section 2 at 388: name 27, type 9, flags 40, addr 0, size 24
D: section 3 at 3b0: name 37, type 1, flags 3, addr 0, size 0
D: section 4 at 3d8: name 43, type 8, flags 3, addr 0, size 0
D: section 5 at 400: name 48, type 1, flags 2, addr 0, size 63
D: section 6 at 428: name 60, type 1, flags 2, addr 0, size 8
D: section 7 at 450: name 56, type 9, flags 40, addr 0, size 16
D: section 8 at 478: name 74, type 1, flags 30, addr 0, size 33
D: section 9 at 4a0: name 83, type 1879048195, flags 0, addr 0, size 48
D: section 10 at 4c8: name 1, type 2, flags 0, addr 0, size 320
D: symtab at 10
D: section 11 at 4f0: name 9, type 3, flags 0, addr 0, size 77
D: strtab at 11
D: section 12 at 518: name 17, type 3, flags 0, addr 0, size 99
D: shstrtab at 12
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .bss
D: section 5 name .rodata
D: section 6 name .exported_sym
D: section 7 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 8 name .comment
D: Not copied section .comment
D: section 9 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 10 name .symtab
D: Not copied section .symtab
D: section 11 name .strtab
D: Not copied section .strtab
D: section 12 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 20
D: unhandled symbol 1, name syscalls_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 4
D: unhandled symbol 5, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 6, name ext_syscall_ok, type tag 2, bind 0, sect 1
D: unhandled symbol 7, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 8, name , type tag 3, bind 0, sect 5
D: unhandled symbol 9, name $d, type tag 0, bind 0, sect 5
D: unhandled symbol 10, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 11, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 12, name , type tag 3, bind 0, sect 6
D: unhandled symbol 13, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 14, name test_entry_sym, type tag 1, bind 0, sect 6
D: unhandled symbol 15, name , type tag 3, bind 0, sect 8
D: unhandled symbol 16, name , type tag 3, bind 0, sect 9
D: unhandled symbol 17, name z_impl_ext_syscall_ok, type tag 0, bind 1, sect 0
D: function symbol 18, name test_entry, type tag 2, bind 1, sect 1
D: unhandled symbol 19, name printk, type tag 0, bind 1, sect 0
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name test_entry addr 0x20001cfd
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 10 has 3 relocations
D: relocation 2:0 info 1102 (type 2, sym 17) offset 24 sym_name z_impl_ext_syscall_ok sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_ext_syscall_ok at 0x8008d7f
I: writing relocation symbol z_impl_ext_syscall_ok type 2 sym 17 at addr 0x20001cf8 addr 0x8008d7f
D: 2 20001cf8 8008d7f z_impl_ext_syscall_ok
D: relocation 2:1 info 802 (type 2, sym 8) offset 68 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 8 at addr 0x20001d24 addr 0x20001d60
D: 2 20001d24 20001d60 
D: relocation 2:2 info 1302 (type 2, sym 19) offset 72 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 19 at addr 0x20001d28 addr 0x8009129
D: 2 20001d28 8009129 printk
D: relocation section .rel.exported_sym (7) linked to section 10 has 2 relocations
D: relocation 7:0 info 802 (type 2, sym 8) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001d60
I: writing relocation symbol  type 2 sym 8 at addr 0x20001dc0 addr 0x20001d60
D: 2 20001dc0 20001d60 
D: relocation 7:1 info 1202 (type 2, sym 18) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001cfd
I: writing relocation symbol test_entry type 2 sym 18 at addr 0x20001dc4 addr 0x20001cfd
D: 2 20001dc4 20001cfd test_entry
D: sym 0x20001cfd name test_entry in 0x20001cc4
D: loaded module, .text at 0x20001ce0, .rodata at 0x20001d60
I: Loaded extension syscalls
Input: 41 Expected output: 42 Actual output: 42
D: freeing memory region 0
D: freeing memory region 2
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_syscalls in 0.429 seconds
===================================================================
START - test_load_unload_threads_kernel_objects
D: Loading relocatable or shared elf
D: Finding ELF tables...
D: section 0 at 744: name 0, type 0, flags 0, addr 0, size 0
D: section 1 at 76c: name 31, type 1, flags 6, addr 0, size 408
D: section 2 at 794: name 27, type 9, flags 40, addr 0, size 144
D: section 3 at 7bc: name 37, type 1, flags 3, addr 0, size 0
D: section 4 at 7e4: name 43, type 8, flags 3, addr 0, size 0
D: section 5 at 80c: name 48, type 1, flags 2, addr 0, size 159
D: section 6 at 834: name 60, type 1, flags 2, addr 0, size 8
D: section 7 at 85c: name 56, type 9, flags 40, addr 0, size 16
D: section 8 at 884: name 74, type 1, flags 30, addr 0, size 33
D: section 9 at 8ac: name 83, type 1879048195, flags 0, addr 0, size 48
D: section 10 at 8d4: name 1, type 2, flags 0, addr 0, size 672
D: symtab at 10
D: section 11 at 8fc: name 9, type 3, flags 0, addr 0, size 216
D: strtab at 11
D: section 12 at 924: name 17, type 3, flags 0, addr 0, size 99
D: shstrtab at 12
D: Allocate and copy strings...
D: Mapping ELF sections...
D: section 0 name 
D: Not copied section 
D: section 1 name .text
D: section 2 name .rel.text
D: Not copied section .rel.text
D: section 3 name .data
D: section 4 name .bss
D: section 5 name .rodata
D: section 6 name .exported_sym
D: section 7 name .rel.exported_sym
D: Not copied section .rel.exported_sym
D: section 8 name .comment
D: Not copied section .comment
D: section 9 name .ARM.attributes
D: Not copied section .ARM.attributes
D: section 10 name .symtab
D: Not copied section .symtab
D: section 11 name .strtab
D: Not copied section .strtab
D: section 12 name .shstrtab
D: Not copied section .shstrtab
D: Allocate and copy sections...
D: Counting exported symbols...
D: symbol count 42
D: unhandled symbol 1, name threads_kernel_objects_ext.c, type tag 4, bind 0, sect 65521
D: unhandled symbol 2, name , type tag 3, bind 0, sect 1
D: unhandled symbol 3, name , type tag 3, bind 0, sect 3
D: unhandled symbol 4, name , type tag 3, bind 0, sect 4
D: unhandled symbol 5, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 6, name k_thread_create, type tag 2, bind 0, sect 1
D: unhandled symbol 7, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 8, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 9, name k_thread_join, type tag 2, bind 0, sect 1
D: unhandled symbol 10, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 11, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 12, name k_thread_start, type tag 2, bind 0, sect 1
D: unhandled symbol 13, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 14, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 15, name k_sem_take, type tag 2, bind 0, sect 1
D: unhandled symbol 16, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 17, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 18, name k_sem_give, type tag 2, bind 0, sect 1
D: unhandled symbol 19, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 20, name , type tag 3, bind 0, sect 5
D: unhandled symbol 21, name $d, type tag 0, bind 0, sect 5
D: unhandled symbol 22, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 23, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 24, name $t, type tag 0, bind 0, sect 1
D: unhandled symbol 25, name $d, type tag 0, bind 0, sect 1
D: unhandled symbol 26, name , type tag 3, bind 0, sect 6
D: unhandled symbol 27, name $d, type tag 0, bind 0, sect 6
D: unhandled symbol 28, name test_entry_sym, type tag 1, bind 0, sect 6
D: unhandled symbol 29, name , type tag 3, bind 0, sect 8
D: unhandled symbol 30, name , type tag 3, bind 0, sect 9
D: unhandled symbol 31, name z_impl_k_thread_create, type tag 0, bind 1, sect 0
D: unhandled symbol 32, name z_impl_k_thread_join, type tag 0, bind 1, sect 0
D: unhandled symbol 33, name z_impl_k_thread_start, type tag 0, bind 1, sect 0
D: unhandled symbol 34, name z_impl_k_sem_take, type tag 0, bind 1, sect 0
D: unhandled symbol 35, name z_impl_k_sem_give, type tag 0, bind 1, sect 0
D: function symbol 36, name test_thread, type tag 2, bind 1, sect 1
D: unhandled symbol 37, name printk, type tag 0, bind 1, sect 0
D: unhandled symbol 38, name my_sem, type tag 0, bind 1, sect 0
D: function symbol 39, name test_entry, type tag 2, bind 1, sect 1
D: unhandled symbol 40, name my_thread_stack, type tag 0, bind 1, sect 0
D: unhandled symbol 41, name my_thread, type tag 0, bind 1, sect 0
D: Allocating memory for symbol table...
D: Copying symbols...
D: function symbol 0 name test_thread addr 0x20001e25
D: function symbol 1 name test_entry addr 0x20001e59
D: Linking ELF...
D: relocation section .rel.text (2) linked to section 10 has 18 relocations
D: relocation 2:0 info 1f02 (type 2, sym 31) offset 64 sym_name z_impl_k_thread_create sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_k_thread_create at 0x800585d
I: writing relocation symbol z_impl_k_thread_create type 2 sym 31 at addr 0x20001da0 addr 0x800585d
D: 2 20001da0 800585d z_impl_k_thread_create
D: relocation 2:1 info 2002 (type 2, sym 32) offset 100 sym_name z_impl_k_thread_join sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_k_thread_join at 0x8006c2d
I: writing relocation symbol z_impl_k_thread_join type 2 sym 32 at addr 0x20001dc4 addr 0x8006c2d
D: 2 20001dc4 8006c2d z_impl_k_thread_join
D: relocation 2:2 info 2102 (type 2, sym 33) offset 128 sym_name z_impl_k_thread_start sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_k_thread_start at 0x8009c01
I: writing relocation symbol z_impl_k_thread_start type 2 sym 33 at addr 0x20001de0 addr 0x8009c01
D: 2 20001de0 8009c01 z_impl_k_thread_start
D: relocation 2:3 info 2202 (type 2, sym 34) offset 164 sym_name z_impl_k_sem_take sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_k_sem_take at 0x8004f91
I: writing relocation symbol z_impl_k_sem_take type 2 sym 34 at addr 0x20001e04 addr 0x8004f91
D: 2 20001e04 8004f91 z_impl_k_sem_take
D: relocation 2:4 info 2302 (type 2, sym 35) offset 192 sym_name z_impl_k_sem_give sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol z_impl_k_sem_give at 0x8004ee1
I: writing relocation symbol z_impl_k_sem_give type 2 sym 35 at addr 0x20001e20 addr 0x8004ee1
D: 2 20001e20 8004ee1 z_impl_k_sem_give
D: relocation 2:5 info 1402 (type 2, sym 20) offset 236 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001e4c addr 0x20001f20
D: 2 20001e4c 20001f20 
D: relocation 2:6 info 2502 (type 2, sym 37) offset 240 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 37 at addr 0x20001e50 addr 0x8009129
D: 2 20001e50 8009129 printk
D: relocation 2:7 info 2602 (type 2, sym 38) offset 244 sym_name my_sem sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol my_sem at 0x200000d4
I: writing relocation symbol my_sem type 2 sym 38 at addr 0x20001e54 addr 0x200000d4
D: 2 20001e54 200000d4 my_sem
D: relocation 2:8 info 1402 (type 2, sym 20) offset 368 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001ed0 addr 0x20001f20
D: 2 20001ed0 20001f20 
D: relocation 2:9 info 2502 (type 2, sym 37) offset 372 sym_name printk sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol printk at 0x8009129
I: writing relocation symbol printk type 2 sym 37 at addr 0x20001ed4 addr 0x8009129
D: 2 20001ed4 8009129 printk
D: relocation 2:10 info 2602 (type 2, sym 38) offset 376 sym_name my_sem sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol my_sem at 0x200000d4
I: writing relocation symbol my_sem type 2 sym 38 at addr 0x20001ed8 addr 0x200000d4
D: 2 20001ed8 200000d4 my_sem
D: relocation 2:11 info 1402 (type 2, sym 20) offset 380 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001edc addr 0x20001f20
D: 2 20001edc 20001f20 
D: relocation 2:12 info 2402 (type 2, sym 36) offset 384 sym_name test_thread sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_thread addr 0x20001e25
I: writing relocation symbol test_thread type 2 sym 36 at addr 0x20001ee0 addr 0x20001e25
D: 2 20001ee0 20001e25 test_thread
D: relocation 2:13 info 2802 (type 2, sym 40) offset 388 sym_name my_thread_stack sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol my_thread_stack at 0x200006e8
I: writing relocation symbol my_thread_stack type 2 sym 40 at addr 0x20001ee4 addr 0x200006e8
D: 2 20001ee4 200006e8 my_thread_stack
D: relocation 2:14 info 2902 (type 2, sym 41) offset 392 sym_name my_thread sym_type 0 sym_bind 1 sym_ndx 0
I: found symbol my_thread at 0x200000e8
I: writing relocation symbol my_thread type 2 sym 41 at addr 0x20001ee8 addr 0x200000e8
D: 2 20001ee8 200000e8 my_thread
D: relocation 2:15 info 1402 (type 2, sym 20) offset 396 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001eec addr 0x20001f20
D: 2 20001eec 20001f20 
D: relocation 2:16 info 1402 (type 2, sym 20) offset 400 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001ef0 addr 0x20001f20
D: 2 20001ef0 20001f20 
D: relocation 2:17 info 1402 (type 2, sym 20) offset 404 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001ef4 addr 0x20001f20
D: 2 20001ef4 20001f20 
D: relocation section .rel.exported_sym (7) linked to section 10 has 2 relocations
D: relocation 7:0 info 1402 (type 2, sym 20) offset 0 sym_name  sym_type 3 sym_bind 0 sym_ndx 5
I: found section symbol  addr 0x20001f20
I: writing relocation symbol  type 2 sym 20 at addr 0x20001fe0 addr 0x20001f20
D: 2 20001fe0 20001f20 
D: relocation 7:1 info 2702 (type 2, sym 39) offset 4 sym_name test_entry sym_type 2 sym_bind 1 sym_ndx 1
I: found section symbol test_entry addr 0x20001e59
I: writing relocation symbol test_entry type 2 sym 39 at addr 0x20001fe4 addr 0x20001e59
D: 2 20001fe4 20001e59 test_entry
D: sym 0x20001e59 name test_entry in 0x20001d44
D: loaded module, .text at 0x20001d60, .rodata at 0x20001f20
I: Loaded extension threads_kernel_
Give semaphore from main thread
Creating thread
Starting thread
Joining thread
Take semaphore from test thread
Test thread joined
D: freeing memory region 0
D: freeing memory region 2
D: freeing memory region 4
D: freeing memory region 5
D: freeing memory region 6
D: freeing memory region 7
 PASS - test_load_unload_threads_kernel_objects in 0.930 seconds
===================================================================
START - test_printk_exported
 PASS - test_printk_exported in 0.001 seconds
===================================================================
TESTSUITE llext succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [llext]: pass = 8, fail = 0, skip = 0, total = 8 duration = 3.858 seconds
 - PASS - [llext.test_ext_syscall_fail] duration = 0.001 seconds
 - PASS - [llext.test_load_unload_hello_world] duration = 0.403 seconds
 - PASS - [llext.test_load_unload_logging] duration = 0.683 seconds
 - PASS - [llext.test_load_unload_object] duration = 0.532 seconds
 - PASS - [llext.test_load_unload_relative_jump] duration = 0.879 seconds
 - PASS - [llext.test_load_unload_syscalls] duration = 0.429 seconds
 - PASS - [llext.test_load_unload_threads_kernel_objects] duration = 0.930 seconds
 - PASS - [llext.test_printk_exported] duration = 0.001 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL

So looks it's something related maybe to my project configuration ?

@teburd
Copy link
Collaborator

teburd commented May 21, 2024

Can you give me a few details, what device are you trying this on? How was the extension built?

@joelguittet
Copy link
Contributor Author

@teburd hello, I provided these information in the first message of this issue, with details.

@joelguittet
Copy link
Contributor Author

joelguittet commented May 22, 2024

Redone a new test rebuilding and flashing my target with CONFIG_ARM_MPU=n and it works! 🎉 🎉 🎉
Not sure why it wasn't before. So it appears this is a mandatory condition to get the LLEXT modules working, isn't it ?

https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/llext/shell_loader/README.rst indicates: "You may need to disable memory protection for the sample to work (e.g. CONFIG_ARM_MPU=n)."
So when it is required to disable MPU and when is it possible to not disable MPU on the device ? This readme is not enough explicit, and moreover I think this is an information that should be indicated in LLEXT doc (https://github.com/zephyrproject-rtos/zephyr/blob/main/doc/services/llext/index.rst).

If disabling MPU is a requirement to LLEXT, how is it possible to unselect CONFIG_ARM_MPU when CONFIG_LLEXT is enabled ? (what should be the proper ay to achieve it ? "depends on !ARM_MPU" in the LLEXT menuconfig ?? I can do a PR for that :-) )

@teburd
Copy link
Collaborator

teburd commented May 22, 2024

Its not required that CONFIG_ARM_MPU=n, but if you want to use the MPU and loadable extensions, we need to be able to setup memory region permissions. That today requires CONFIG_USERSPACE=y

So the options are

CONFIG_ARM_MPU=n || CONFIG_USERSPACE=y

Note that using userspace may not be enough, if you look at the test I setup a thread (both in supervisor mode and user mode) before calling into the extension with the regions setup. That's because some arm parts (nxp kinetis for example) don't have many mpu regions to work with, and the thread context to run from needs to have access to the .text of the extension today.

There's some other ways of solving the problem that I didn't explore because the tools to setup regions with permissions was already there with user space (memory domains and partitions)

I'd very happily accept pull requests updating the documentation to reflect this if its not clear

@joelguittet
Copy link
Contributor Author

Okkkk good, thanks for the details @teburd !!!
Considering this issue is closed so, thanks for your attention on this.
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Linkable Loadable Extensions area: llext Linkable Loadable Extensions bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants