mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
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:
parent
5cc79c7dfd
commit
13a9afa36d
5 changed files with 29 additions and 32 deletions
|
@ -21,16 +21,16 @@
|
|||
#include "string.h"
|
||||
|
||||
extern struct common_area common_area;
|
||||
extern char __data_src_start__, __data_start__, __data_end__, __bss_start__, __bss_end__;
|
||||
extern char __data_src_start__[], __data_start__[], __data_end__[], __bss_start__[], __bss_end__[];
|
||||
|
||||
#ifndef WITH_NO_COMPRESSION
|
||||
static void uncompress_data_section(void) {
|
||||
int avail_in;
|
||||
memcpy(&avail_in, &__data_src_start__, sizeof(int));
|
||||
int avail_out = &__data_end__ - &__data_start__; // uncompressed size. Correct.
|
||||
memcpy(&avail_in, __data_src_start__, sizeof(int));
|
||||
int avail_out = __data_end__ - __data_start__; // uncompressed size. Correct.
|
||||
// uncompress data segment to RAM
|
||||
uintptr_t p = (uintptr_t)&__data_src_start__;
|
||||
int res = LZ4_decompress_safe((char *)p + 4, &__data_start__, avail_in, avail_out);
|
||||
char *p = __data_src_start__;
|
||||
int res = LZ4_decompress_safe(p + 4, __data_start__, avail_in, avail_out);
|
||||
|
||||
if (res < 0)
|
||||
return;
|
||||
|
@ -53,18 +53,16 @@ void Vector(void) {
|
|||
|
||||
/* Set up data segment: Copy from flash to ram */
|
||||
#ifdef WITH_NO_COMPRESSION
|
||||
char *data_src = &__data_src_start__;
|
||||
char *data_dst = &__data_start__;
|
||||
char *data_end = &__data_end__;
|
||||
while (data_dst < data_end) *data_dst++ = *data_src++;
|
||||
char *data_src = __data_src_start__;
|
||||
char *data_dst = __data_start__;
|
||||
while (data_dst < __data_end__) *data_dst++ = *data_src++;
|
||||
#else
|
||||
uncompress_data_section();
|
||||
#endif
|
||||
|
||||
/* Set up (that is: clear) BSS. */
|
||||
char *bss_dst = &__bss_start__;
|
||||
char *bss_end = &__bss_end__;
|
||||
while (bss_dst < bss_end) *bss_dst++ = 0;
|
||||
char *bss_dst = __bss_start__;
|
||||
while (bss_dst < __bss_end__) *bss_dst++ = 0;
|
||||
|
||||
AppMain();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue