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

[BUG] modlib bug on esp32-devkitc:module #14731

Closed
1 task done
anjiahao1 opened this issue Nov 12, 2024 · 1 comment · Fixed by #14732
Closed
1 task done

[BUG] modlib bug on esp32-devkitc:module #14731

anjiahao1 opened this issue Nov 12, 2024 · 1 comment · Fixed by #14732
Labels
Arch: xtensa Issues related to the Xtensa architecture Area: Build system OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working

Comments

@anjiahao1
Copy link
Contributor

anjiahao1 commented Nov 12, 2024

Description / Steps to reproduce the issue

bug on #13819

 xtensa-esp32-elf-readelf -S chardev
There are 25 section headers, starting at offset 0xa58:

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 0000ce 00  AX  0   0  4
  [ 2] .rela.text        RELA            00000000 0005a8 000234 0c   I 22   1  4
  [ 3] .literal.cha[...] PROGBITS        00000000 000104 000000 00  AX  0   0  4
  [ 4] .literal.cha[...] PROGBITS        00000000 000104 000000 00  AX  0   0  4
  [ 5] .literal.exi[...] PROGBITS        00000000 000104 000000 00  AX  0   0  4
  [ 6] .literal.sta[...] PROGBITS        00000000 000104 000000 00  AX  0   0  4
  [ 7] .init_array       INIT_ARRAY      00000000 000104 000000 04  WA  0   0  1
  [ 8] .rodata           PROGBITS        00000000 000104 0000fd 00   A  0   0  4
  [ 9] .rela.rodata      RELA            00000000 0007dc 000018 0c   I 22   8  4
  [10] .data             PROGBITS        000000fd 000201 000003 00  WA  0   0  1
  [11] .dtors            PROGBITS        00000000 000204 000004 00  WA  0   0  4
  [12] .rela.dtors       RELA            00000000 0007f4 00000c 0c   I 22  11  4
  [13] .ctors            PROGBITS        00000000 000208 000004 00  WA  0   0  4
  [14] .rela.ctors       RELA            00000000 000800 00000c 0c   I 22  13  4
  [15] .bss              NOBITS          00000004 00020c 000000 00  WA  0   0  1
  [16] .comment          PROGBITS        00000000 00020c 000030 01  MS  0   0  1
  [17] .xtensa.info      NOTE            00000000 00023c 000038 00      0   0  1
  [18] .xt.lit           PROGBITS        00000000 000274 000020 00      0   0  1
  [19] .rela.xt.lit      RELA            00000000 00080c 000030 0c   I 22  18  4
  [20] .xt.prop          PROGBITS        00000000 000294 000114 00      0   0  1
  [21] .rela.xt.prop     RELA            00000000 00083c 000114 0c   I 22  20  4
  [22] .symtab           SYMTAB          00000000 0003a8 000160 10     23   5  4
  [23] .strtab           STRTAB          00000000 000508 00009e 00      0   0  1
  [24] .shstrtab         STRTAB          00000000 000950 000105 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),
  D (mbind), p (processor specific)

[13] .ctors PROGBITS section 13 is PROGBITS not a SHT_INIT_ARRAY Caused the bug

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

ubuntu 24.04

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: Build System]

Verification

  • I have verified before submitting the report.
@anjiahao1 anjiahao1 added the Type: Bug Something isn't working label Nov 12, 2024
@github-actions github-actions bot added Arch: xtensa Issues related to the Xtensa architecture Area: Build system OS: Linux Issues related to Linux (building system, etc) labels Nov 12, 2024
@anjiahao1
Copy link
Contributor Author

anjiahao1 commented Nov 12, 2024

@tmedicci It looks like xtensa's gcc doesn't mark the constructor_function .ctors as INIT_ARRAY properly, causing some initialization problems. Any tips?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: xtensa Issues related to the Xtensa architecture Area: Build system OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant