You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2023/09/25 09:47:48 UTC
[mynewt-core] 03/03: Provide mynewt_main in linker scripts
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 8a8077215e7d8166ce67aff30cf742da74fe5c93
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed Jun 14 06:37:58 2023 +0200
Provide mynewt_main in linker scripts
---
hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld | 1 +
hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld | 1 +
hw/bsp/hifive1/hifive1.ld | 1 +
hw/bsp/usbmkw41z/boot-mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/no-boot-mkw41z512.ld | 1 +
hw/mcu/ambiq/apollo2/apollo2.ld | 1 +
hw/mcu/ambiq/apollo3/apollo3.ld | 3 +-
hw/mcu/dialog/da1469x/da1469x.ld | 1 +
hw/mcu/dialog/da1469x/da1469x_ram_resident.ld | 1 +
hw/mcu/nordic/nrf51xxx/nrf51.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340_net/nrf5340_net.ld | 1 +
.../nordic/nrf5340_net/nrf5340_net_ram_resident.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld | 1 +
hw/mcu/stm/stm32f0xx/stm32f0xx.ld | 1 +
hw/mcu/stm/stm32f1xx/stm32f103.ld | 1 +
hw/mcu/stm/stm32f3xx/stm32f303.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f401.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f407.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f411.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f413.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f427.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f429.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f439.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f746.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f767.ld | 1 +
hw/mcu/stm/stm32h7xx/stm32h723.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l072.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l073.ld | 1 +
hw/mcu/stm/stm32l1xx/stm32l152.ld | 1 +
hw/mcu/stm/stm32l4xx/stm32l476.ld | 1 +
hw/mcu/stm/stm32u5xx/stm32u5xx.ld | 1 +
hw/mcu/stm/stm32wbxx/stm32wb55.ld | 116 +++++++++++----------
libc/baselibc/pkg.yml | 1 +
39 files changed, 101 insertions(+), 55 deletions(-)
diff --git a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
index a14123a64..a3276b2a7 100644
--- a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
+++ b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
@@ -104,6 +104,7 @@ SECTIONS
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld b/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
index 55aace42e..ccf5b652b 100644
--- a/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
+++ b/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
@@ -73,6 +73,7 @@ SECTIONS
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/hifive1/hifive1.ld b/hw/bsp/hifive1/hifive1.ld
index 40ff08b1b..accf18a2d 100644
--- a/hw/bsp/hifive1/hifive1.ld
+++ b/hw/bsp/hifive1/hifive1.ld
@@ -42,6 +42,7 @@ SECTIONS
*(.text.startup .text.startup.*)
*(.text .text.*)
*(.gnu.linkonce.t.*)
+ PROVIDE(mynewt_main = main);
} >flash
.fini :
diff --git a/hw/bsp/usbmkw41z/boot-mkw41z512.ld b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
index 58612c76c..99c766a0d 100644
--- a/hw/bsp/usbmkw41z/boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
@@ -101,6 +101,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/usbmkw41z/mkw41z512.ld b/hw/bsp/usbmkw41z/mkw41z512.ld
index e07d64f7c..491a1ac40 100644
--- a/hw/bsp/usbmkw41z/mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/mkw41z512.ld
@@ -91,6 +91,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
index 9889c0f92..6dff11457 100644
--- a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
@@ -101,6 +101,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/ambiq/apollo2/apollo2.ld b/hw/mcu/ambiq/apollo2/apollo2.ld
index 7ab6323b6..3c15b58fe 100644
--- a/hw/mcu/ambiq/apollo2/apollo2.ld
+++ b/hw/mcu/ambiq/apollo2/apollo2.ld
@@ -83,6 +83,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
diff --git a/hw/mcu/ambiq/apollo3/apollo3.ld b/hw/mcu/ambiq/apollo3/apollo3.ld
index 4dfc53706..b2f308311 100644
--- a/hw/mcu/ambiq/apollo3/apollo3.ld
+++ b/hw/mcu/ambiq/apollo3/apollo3.ld
@@ -46,6 +46,7 @@ SECTIONS
*(.rodata)
*(.rodata*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
@@ -149,4 +150,4 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/dialog/da1469x/da1469x.ld b/hw/mcu/dialog/da1469x/da1469x.ld
index e1ff35452..9f1e29bd5 100644
--- a/hw/mcu/dialog/da1469x/da1469x.ld
+++ b/hw/mcu/dialog/da1469x/da1469x.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld b/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
index b12dac458..0caf676f2 100644
--- a/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
+++ b/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
@@ -73,6 +73,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > RAM
.ARM.extab :
diff --git a/hw/mcu/nordic/nrf51xxx/nrf51.ld b/hw/mcu/nordic/nrf51xxx/nrf51.ld
index 55070815a..ea89e0f3e 100644
--- a/hw/mcu/nordic/nrf51xxx/nrf51.ld
+++ b/hw/mcu/nordic/nrf51xxx/nrf51.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52.ld b/hw/mcu/nordic/nrf52xxx/nrf52.ld
index f3f8b4cbe..af7de107e 100644
--- a/hw/mcu/nordic/nrf52xxx/nrf52.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld b/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf5340/nrf5340.ld b/hw/mcu/nordic/nrf5340/nrf5340.ld
index e29139a89..d8e27e769 100644
--- a/hw/mcu/nordic/nrf5340/nrf5340.ld
+++ b/hw/mcu/nordic/nrf5340/nrf5340.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld b/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
index 3f1d89c6e..05dfd466e 100644
--- a/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
+++ b/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld b/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
index 9a6426432..f235d6d5f 100644
--- a/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
+++ b/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld b/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
+++ b/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf91xx/nrf91.ld b/hw/mcu/nordic/nrf91xx/nrf91.ld
index f3f8b4cbe..af7de107e 100644
--- a/hw/mcu/nordic/nrf91xx/nrf91.ld
+++ b/hw/mcu/nordic/nrf91xx/nrf91.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld b/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
+++ b/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/stm/stm32f0xx/stm32f0xx.ld b/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
index 997c6de2d..a9602ac84 100644
--- a/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
+++ b/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f1xx/stm32f103.ld b/hw/mcu/stm/stm32f1xx/stm32f103.ld
index 5e0b49702..5a646e5ee 100644
--- a/hw/mcu/stm/stm32f1xx/stm32f103.ld
+++ b/hw/mcu/stm/stm32f1xx/stm32f103.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f3xx/stm32f303.ld b/hw/mcu/stm/stm32f3xx/stm32f303.ld
index bf89bb4aa..b7ee776c3 100644
--- a/hw/mcu/stm/stm32f3xx/stm32f303.ld
+++ b/hw/mcu/stm/stm32f3xx/stm32f303.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f401.ld b/hw/mcu/stm/stm32f4xx/stm32f401.ld
index 75fc436d8..40a35de32 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f401.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f401.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f407.ld b/hw/mcu/stm/stm32f4xx/stm32f407.ld
index 1943af642..51eaa3b47 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f407.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f407.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f411.ld b/hw/mcu/stm/stm32f4xx/stm32f411.ld
index 75fc436d8..40a35de32 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f411.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f411.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f413.ld b/hw/mcu/stm/stm32f4xx/stm32f413.ld
index ab253afb1..7615341cd 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f413.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f413.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f427.ld b/hw/mcu/stm/stm32f4xx/stm32f427.ld
index 1943af642..51eaa3b47 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f427.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f427.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f429.ld b/hw/mcu/stm/stm32f4xx/stm32f429.ld
index 134ab0db6..e473e33ff 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f429.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f429.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f439.ld b/hw/mcu/stm/stm32f4xx/stm32f439.ld
index 134ab0db6..e473e33ff 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f439.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f439.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f7xx/stm32f746.ld b/hw/mcu/stm/stm32f7xx/stm32f746.ld
index f0a430eac..2b017b47a 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f746.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f746.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f7xx/stm32f767.ld b/hw/mcu/stm/stm32f7xx/stm32f767.ld
index f0a430eac..2b017b47a 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f767.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f767.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32h7xx/stm32h723.ld b/hw/mcu/stm/stm32h7xx/stm32h723.ld
index 54a43b5a5..2e41eed0b 100644
--- a/hw/mcu/stm/stm32h7xx/stm32h723.ld
+++ b/hw/mcu/stm/stm32h7xx/stm32h723.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l0xx/stm32l072.ld b/hw/mcu/stm/stm32l0xx/stm32l072.ld
index 8e62759a5..15b0a8007 100644
--- a/hw/mcu/stm/stm32l0xx/stm32l072.ld
+++ b/hw/mcu/stm/stm32l0xx/stm32l072.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l0xx/stm32l073.ld b/hw/mcu/stm/stm32l0xx/stm32l073.ld
index 8e62759a5..15b0a8007 100644
--- a/hw/mcu/stm/stm32l0xx/stm32l073.ld
+++ b/hw/mcu/stm/stm32l0xx/stm32l073.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l1xx/stm32l152.ld b/hw/mcu/stm/stm32l1xx/stm32l152.ld
index 5e0b49702..5a646e5ee 100644
--- a/hw/mcu/stm/stm32l1xx/stm32l152.ld
+++ b/hw/mcu/stm/stm32l1xx/stm32l152.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l4xx/stm32l476.ld b/hw/mcu/stm/stm32l4xx/stm32l476.ld
index 26f817624..e0b6bf2cf 100644
--- a/hw/mcu/stm/stm32l4xx/stm32l476.ld
+++ b/hw/mcu/stm/stm32l4xx/stm32l476.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32u5xx/stm32u5xx.ld b/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
index 26f817624..e0b6bf2cf 100644
--- a/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
+++ b/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32wbxx/stm32wb55.ld b/hw/mcu/stm/stm32wbxx/stm32wb55.ld
index c408dea42..bc61dc028 100644
--- a/hw/mcu/stm/stm32wbxx/stm32wb55.ld
+++ b/hw/mcu/stm/stm32wbxx/stm32wb55.ld
@@ -1,54 +1,59 @@
-/**
-*****************************************************************************
-**
-** File : stm32wb55xx_flash_cm4.ld
-**
-** Abstract : System Workbench Minimal System calls file
-**
-** For more information about which c-functions
-** need which of these lowlevel functions
-** please consult the Newlib libc-manual
-**
-** Environment : System Workbench for MCU
-**
-** Distribution: The file is distributed “as is,” without any warranty
-** of any kind.
-**
-*****************************************************************************
-**
-** <h2><center>© COPYRIGHT(c) 2019 Ac6</center></h2>
-**
-** Redistribution and use in source and binary forms, with or without modification,
-** are permitted provided that the following conditions are met:
-** 1. Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** 2. Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** 3. Neither the name of Ac6 nor the names of its contributors
-** may be used to endorse or promote products derived from this software
-** without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* Linker script to place sections and symbol values. Should be used together
+ * with other linker script that defines memory regions FLASH and RAM.
+ * It references following symbols, which must be defined in code:
+ * Reset_Handler : Entry of reset handler
+ *
+ * It defines following symbols, which code can use without definition:
+ * __exidx_start
+ * __exidx_end
+ * __etext
+ * __data_start__
+ * __preinit_array_start
+ * __preinit_array_end
+ * __init_array_start
+ * __init_array_end
+ * __fini_array_start
+ * __fini_array_end
+ * __data_end__
+ * __bss_start__
+ * __bss_end__
+ * __end__
+ * end
+ * __HeapBase
+ * __HeapLimit
+ * __StackLimit
+ * __StackTop
+ * __stack
+ * __coredata_start__
+ * __coredata_end__
+ * __corebss_start__
+ * __corebss_end__
+ * __ecoredata
+ * __ecorebss
+ */
ENTRY(Reset_Handler)
_estack = ORIGIN(RAM) + LENGTH(RAM);
-/* Define output sections */
SECTIONS
{
/* Reserve space at the start of the image for the header. */
@@ -57,9 +62,10 @@ SECTIONS
. = . + _imghdr_size;
} > FLASH
+ __text = .;
+
.text :
{
- . = ALIGN(8);
__isr_vector_start = .;
KEEP(*(.isr_vector))
__isr_vector_end = .;
@@ -73,14 +79,14 @@ SECTIONS
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
- . = ALIGN(8);
+ . = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
- . = ALIGN(8);
+ . = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
@@ -104,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
@@ -123,16 +130,17 @@ SECTIONS
.vector_relocation :
{
- . = ALIGN(8);
+ . = ALIGN(4);
__vector_tbl_reloc__ = .;
. = . + (__isr_vector_end - __isr_vector_start);
+ . = ALIGN(4);
} > RAM
.coredata :
{
- . = ALIGN(8);
__coredata_start__ = .;
*(.data.core)
+ . = ALIGN(4);
__coredata_end__ = .;
} > RAM AT > FLASH
@@ -142,14 +150,14 @@ SECTIONS
.data :
{
- . = ALIGN(8);
+ . = ALIGN(4);
_sdata = .;
__data_start__ = _sdata;
*(vtable)
*(.data*)
KEEP(*(.jcr*))
- . = ALIGN(8);
+ . = ALIGN(4);
/* All data end */
_edata = .;
__data_end__ = _edata;
diff --git a/libc/baselibc/pkg.yml b/libc/baselibc/pkg.yml
index b751946e8..ee7ff016b 100644
--- a/libc/baselibc/pkg.yml
+++ b/libc/baselibc/pkg.yml
@@ -36,3 +36,4 @@ pkg.cflags:
pkg.lflags:
- -specs=nosys.specs:
+ - -umain