__LIBC_INIT_ARRAY PROBLEMS

Sysprogs forums Forums VisualGDB __LIBC_INIT_ARRAY PROBLEMS

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26585
    mburger
    Participant

    Hi

    Im struggling with a Project based on a VisualGDB with MSMake and STM32F446ME.
    Im using VisualGDB 5.4 and arm-eabi gcc 9.2.1 under VS2019
    The Program hangs approximately as described in this quite old thread. (https://sysprogs.com/w/forums/topic/__libc_init_array-problems/)
    As described in many sources online I checked my compiler Flags.
    “-mthumb -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -mfloat-abi=hard” are set.
    My Linker File is so far untouched.

    My map-file tells me the following:
    c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-init.o)
      c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o (__libc_init_array)
    and
    .text.__libc_init_array
      0x080301fc 0x48 c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-init.o)
        0x080301fc __libc_init_array

    As described I followed the Disassembly to the line where it crashes.

    libc_init_array disassembly

    From this branch with link command it jumps to the listed address where _init: lies.
    But as my Disassembly tells me there are no valid instructions there.
    _init:

    As I certainly can see there are no valid Instructions at the nescessary addresses. And that is why the thing is crashing.
    But why is that?
    Im kind of a bit lost.
    If you need more Info, let me know.

    Thank you for some help in advance!

    Martin

    Attachments:
    You must be logged in to view attached files.
    #26588
    support
    Keymaster

    Hi,

    It looks like the project might contain some settings specific to the older toolchain and would hence require changes in order to be ported to the newer toolchain.

    Based on the disassembly, the contents of the _init symbol is incorrect (filled with 0xFFs), so we would advise finding where it comes from using the .map file and disassembling the .a file that provides it to see if the file is corrupt, or doesn’t make sense with your core/FPU configuration. You can also try creating a new project from scratch, ensuring that the static constructors work in it, and then comparing the _init symbol contents, the .a files mentioned in the .map file and the initialization behavior.

    As another alternative, you can always revert to the old toolchain via Tools->VisualGDB->Manage VisualGDB Packages.

    It also looks like your technical support has expired a while ago, so please consider renewing it here (although we won’t be able to troubleshoot project-specific issues and can only advise the general direction in such cases).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.