Uniformize source code ref and fix gcc 11.1 warning

Using "extern char linker_symbol[]" notation
cf https://sourceware.org/binutils/docs/ld/Source-Code-Reference.html
This commit is contained in:
Philippe Teuwen 2021-05-13 22:15:06 +02:00
commit 13a9afa36d
5 changed files with 29 additions and 32 deletions

View file

@ -14,12 +14,12 @@
#include "dbprint.h"
#include "pm3_cmd.h"
extern uint8_t _stack_start, __bss_end__;
extern char _stack_start[], __bss_end__[];
// BigBuf is the large multi-purpose buffer, typically used to hold A/D samples or traces.
// Also used to hold various smaller buffers and the Mifare Emulator Memory.
// We know that bss is aligned to 4 bytes.
static uint8_t *BigBuf = &__bss_end__;
static uint8_t *BigBuf = (uint8_t *)__bss_end__;
/* BigBuf memory layout:
Pointer to highest available memory: s_bigbuf_hi
@ -69,7 +69,7 @@ static bool tracing = true;
// compute the available size for BigBuf
void BigBuf_initialize(void) {
s_bigbuf_size = (uint32_t)&_stack_start - (uint32_t)&__bss_end__;
s_bigbuf_size = (uint32_t)_stack_start - (uint32_t)__bss_end__;
s_bigbuf_hi = s_bigbuf_size;
trace_len = 0;
}