From 978ae3c451c02cf56453f51e482bed1df939e918 Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Wed, 21 Jun 2023 13:44:45 +0200 Subject: [PATCH] start but not working --- esp-hal-common/ld/sections/fixups/rodata_dummy.x | 2 +- .../ld/sections/fixups/rtc_fast_rwdata_dummy.x | 2 +- esp32s3-hal/.cargo/config.toml | 10 ++++++++-- esp32s3-hal/ld/link-esp32s3.x | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/esp-hal-common/ld/sections/fixups/rodata_dummy.x b/esp-hal-common/ld/sections/fixups/rodata_dummy.x index 8993dd9d1..4b2573e9d 100644 --- a/esp-hal-common/ld/sections/fixups/rodata_dummy.x +++ b/esp-hal-common/ld/sections/fixups/rodata_dummy.x @@ -14,7 +14,7 @@ SECTIONS { /* Create an empty gap as big as .text section */ - . = SIZEOF(.text); + . = . + SIZEOF(.text); /* Prepare the alignment of the section above. Few bytes (0x20) must be * added for the mapping header. diff --git a/esp-hal-common/ld/sections/fixups/rtc_fast_rwdata_dummy.x b/esp-hal-common/ld/sections/fixups/rtc_fast_rwdata_dummy.x index 7409e536f..4729f728a 100644 --- a/esp-hal-common/ld/sections/fixups/rtc_fast_rwdata_dummy.x +++ b/esp-hal-common/ld/sections/fixups/rtc_fast_rwdata_dummy.x @@ -7,7 +7,7 @@ SECTIONS { .rtc_fast.dummy (NOLOAD) : { _rtc_dummy_start = ABSOLUTE(.); /* needed to make section proper size */ - . = SIZEOF(.rtc_fast.text); + . = . + SIZEOF(.rtc_fast.text); _rtc_dummy_end = ABSOLUTE(.); /* needed to make section proper size */ } > RTC_FAST_RWDATA } diff --git a/esp32s3-hal/.cargo/config.toml b/esp32s3-hal/.cargo/config.toml index 48fa7e148..dfd6d18bb 100644 --- a/esp32s3-hal/.cargo/config.toml +++ b/esp32s3-hal/.cargo/config.toml @@ -3,8 +3,14 @@ runner = "espflash flash --monitor" [build] rustflags = [ - "-C", "link-arg=-nostartfiles", - "-C", "link-arg=-Wl,-Tlinkall.x", + # GNU LD + # "-C", "link-arg=-nostartfiles", + # "-C", "link-arg=-Wl,-Tlinkall.x", + + # /Users/mabez/Downloads/esp-clang/bin + # LLD + "-C", "linker=/Users/mabez/Downloads/esp-clang/bin/lld", + "-C", "link-arg=-Tlinkall.x", ] target = "xtensa-esp32s3-none-elf" diff --git a/esp32s3-hal/ld/link-esp32s3.x b/esp32s3-hal/ld/link-esp32s3.x index 6dc441965..0af4c7e1d 100644 --- a/esp32s3-hal/ld/link-esp32s3.x +++ b/esp32s3-hal/ld/link-esp32s3.x @@ -28,7 +28,7 @@ SECTIONS { /* Create an empty gap as big as .rwtext section - 32k (SRAM0) * because SRAM1 is available on the data bus and instruction bus */ - . = MAX(SIZEOF(.rwtext) + SIZEOF(.rwtext.wifi) + RESERVE_ICACHE + VECTORS_SIZE, 32k) - 32k; + . = . + MAX(SIZEOF(.rwtext) + SIZEOF(.rwtext.wifi) + RESERVE_ICACHE + VECTORS_SIZE, 32k) - 32k; /* Prepare the alignment of the section above. */ . = ALIGN(4);