This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

arm-none-eabi-gcc compiler error: thumb-1 mode PLT generation not currently supported

Hello.

I'm trying to use arm-none-eabi-gcc (with several versions such as 10.3-2021.10) on windows to compile a dynamic library for ARM Cortex-M33; If I use compile option with -mcpu=cortex-m33, the build fails with an error "warning: thumb-1 mode PLT generation not currently supported collect2.exe: error: ld returned 1 exit status。".  

Here is an example of my compile and result:

arm-none-eabi-gcc.exe -fPIC -mthumb -mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fPIC -shared -nostdlib -nostartfiles -fdata-sections -ffunction-sections -Og -g0 -o libexternal_qrcode.so

The result:

arm-none-eabi/bin/ld.exe: libexternal_qrcode.so: warning: thumb-1 mode PLT generation not currently supported collect2.exe: error: ld returned 1 exit status。

however, if I change compile option to -mcpu=cortex-m4, the buid succeeds. 

  1. what's the reason for the compile error? 
  2. Will the dynamic library that compile with -mcpu=cortex-m4 can work on Cortex-M33 platform.

Parents
  • Hi!

    Which version of the GNU binutils do you use?

    Tried a simple example with your mentioned compiler/linker arguments for Cortex-M33 and works fine (no errors) with the actually version of GNU-ld and GCC:

    $ arm-none-eabi-gcc -fPIC -mthumb -mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fPIC -shared -nostdlib -nostartfiles -fdata-sections -ffunction-sections -Og -g0 -o libfoo.so foo.c
    $

    Content of foo.c:

    int foo(int a, int b)
    {
       return a + b;
    }

     

    GNU-ld version:

    $ arm-none-eabi-ld --version                                                                          
    GNU ld (GNU Binutils) 2.39.50.20221031
    Copyright (C) 2022 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License version 3 or (at your option) a later version.
    This program has absolutely no warranty.
    $

    GCC version:

    $ arm-none-eabi-gcc --version                                                                        
    arm-none-eabi-gcc (GCC) 12.2.1 20221104
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply
  • Hi!

    Which version of the GNU binutils do you use?

    Tried a simple example with your mentioned compiler/linker arguments for Cortex-M33 and works fine (no errors) with the actually version of GNU-ld and GCC:

    $ arm-none-eabi-gcc -fPIC -mthumb -mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fPIC -shared -nostdlib -nostartfiles -fdata-sections -ffunction-sections -Og -g0 -o libfoo.so foo.c
    $

    Content of foo.c:

    int foo(int a, int b)
    {
       return a + b;
    }

     

    GNU-ld version:

    $ arm-none-eabi-ld --version                                                                          
    GNU ld (GNU Binutils) 2.39.50.20221031
    Copyright (C) 2022 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License version 3 or (at your option) a later version.
    This program has absolutely no warranty.
    $

    GCC version:

    $ arm-none-eabi-gcc --version                                                                        
    arm-none-eabi-gcc (GCC) 12.2.1 20221104
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Children