Questions tagged [arm-none-eabi-gcc]

87 questions
2
votes
3 answers

ARM GCC Address of packed struct warning

In my code, I have something like this: #include typedef struct __attribute__((packed)) { uint8_t test1; uint16_t test2; } test_struct_t; test_struct_t test_struct; int main(void) { uint32_t *ptr = (uint32_t*) &test_struct; …
energetic
  • 897
  • 1
  • 5
  • 7
2
votes
1 answer

GitHub Actions jobs sequence

I'm trying to implement sequence of jobs on GitHub Actions: checkout and upload arm-none-eabi-gcc compiler, next build matrix of different targets, next create release and upload release assets (matrix). For checkout I use actions/checkout@v2 with…
Ivan
  • 42
  • 7
1
vote
1 answer

What flags are needed in arm-none-eabi-gcc to produce FDPIC ELF binary?

what flags do i need to add to: arm-none-eabi-gcc test.c -o test -mcpu=cortex-m4 -Wall -Os to get FDPIC binary ? I made many experiments, and still i receive not a valid format. I know about existence of linker flags: --oformat…
sibislaw
  • 103
  • 1
  • 9
1
vote
1 answer

clangd doesn't find and finds the wrong when using arm-none-eabi-gcc

I'm using VS Code with the clangd plugin and it can't find . Clangd is able to parse all of the source files in my project without any problem. But certain header files are not found by clangd, and for other header files, clangd finds the…
Ryan Jensen
  • 207
  • 1
  • 9
1
vote
1 answer

arm-none-eabi-gcc "is not implemented and will always fail" messages

I have two stm32 projects (one with stm32f103rb and the other with stm32f103re). Both projects are built using cmake and make based on stm32-cmake template and also use cubeMX HAL libraries. For both projects I use this printf library and overall…
mehdi
  • 167
  • 11
1
vote
1 answer

GCC __builtin_expect checking pointer nullability of temporary during constexpr context results in strange run time behavior

I'm using __builtin_expect to perform a null pointer check in a constexpr function like so: constexpr int Add(const int * x, const int * y) { assert(__builtin_expect(!!(x && y), 1)); return *x + *y; } I also have a wrapper method for const…
1
vote
1 answer

What binary elf output format allows me to add a .sram section in my binary when linking?

I am trying to compile an application using arm-none-eabi-gcc and would like specific section names to be contained in my binary. The binary is usually compiled by my IDE. From the official GNU documentation: SECTIONS { ... secname : { …
zupoluzu
  • 51
  • 4
1
vote
1 answer

Duplicate section VMAs of 0 in default linker script

arm-none-eabi-gcc's default linker script defines several sections with VMA of 0. Most of these contain debug information: /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 :…
AJM
  • 1,317
  • 2
  • 15
  • 30
1
vote
2 answers

Gcc Force global variable to a given address using linker only

I'm trying to force a global variable to a specific address without modifying the source code. I'm well aware of solution such as: // C source code MyStruct globalVariable __attribute__((section(".myLinkerSection"))); // Linker script . =…
Lucas
  • 65
  • 9
1
vote
0 answers

How to redefine symbol of object file from the arm-none-eabi compile with -flot flag?

I want redefine malloc symbol to own_malloc, so that I can know memory alloc details and print alloc-size.But I found it don't work when I excuting order: arm-none-eabi-objcopy --redefine-sym malloc=own_malloc test.o the test source: #include…
1
vote
1 answer

How to sort the symbol table (generated by "objdump -t") sequentially by address?

I would like to see at one glance which variables are placed next to each other in memory. If I generate a symbol table by using objdump -t I get the symbol table, however sorted seemingly randomly. SYMBOL TABLE: 00100584 l F .text 00000000…
Stone
  • 33
  • 6
1
vote
1 answer

Weak function definitions for interrupt vector in a static library are preferred over strong ones

Introduction arm-none-eabi-gcc version 10.3-2021.10 20210824 device: nordic nRF52840/nRF52832/nRF52833 library affected: Nordic NRF5 SDK 17.1.0 - custom build system (CMake) I wrote the CMake build system for Nordic NRF5 SDK (natively it only…
1
vote
0 answers

How can I cross-compile openssl for arm-none-eabi-gcc

I want to use the SM2 algorithm from OpenSSL on my stm32 develop board, when I searched a method for that, I found all solutions is to compile OpenSSL by arm-none-linux-gnueabi, so I did it as described. After getting a libcrypt.so, I want to use…
1
vote
1 answer

linking newlib nano with arm-none-eabi gnu toolchain: undefined reference to __libc_init_array

Even though I have scrolled through another similar post regarding this topic, I have not yet managed to solve my issue. I'm working on a bare metal development approach for stm32f411RE and I just got through the need of using embedded standard…
Juan_David
  • 126
  • 2
  • 11
1
vote
2 answers

bare metal embedded c++: undefined reference to memcpy and memset while writing flash to ram

As the tittle suggest, I'm getting an error related to not defining memcpy and memset, even though I'm not directly using it (although I guess it is used for the linker and compiling process given the nature of this error) long story short: I'm…
Juan_David
  • 126
  • 2
  • 11