Fix PIC for PowerPC. Must put `got2` into the flash region.

pull/302/head
David Garske 2023-05-10 16:52:24 -07:00
parent 28ee143a1b
commit a5bb56599c
2 changed files with 4 additions and 6 deletions

View File

@ -316,9 +316,8 @@ endif
ifeq ($(TARGET),nxp_p1021)
# Power PC big endian
ARCH_FLAGS=-m32 -mhard-float -mcpu=e500mc -mno-powerpc64
ARCH_FLAGS=-m32 -mhard-float -mcpu=e500mc
ARCH_FLAGS+=-fno-builtin -ffreestanding -nostartfiles
ARCH_FLAGS+=-mno-pointers-to-nested-functions
CFLAGS+=$(ARCH_FLAGS) -DBIG_ENDIAN_ORDER
CFLAGS+=-DWOLFBOOT_DUALBOOT
CFLAGS+=-pipe # use pipes instead of temp files

View File

@ -36,6 +36,9 @@ SECTIONS
*(.text*)
*(.rodata*)
*(.sdata*)
/* For PIC the linker script variables come from here */
*(.got2)
} > FLASH
. = ALIGN(4);
@ -61,10 +64,6 @@ SECTIONS
.data : AT (_stored_data)
{
_start_data = .;
KEEP(*(.iplt*))
KEEP(*(.plt*))
KEEP(*(.got1*))
KEEP(*(.got2*))
KEEP(*(.data*))
. = ALIGN(4);
KEEP(*(.ramcode))