esp32: move bt linker script placements to ldgen

This commit is contained in:
Renz Bagaporo 2021-02-09 18:44:29 +08:00
parent 115b6ac0ac
commit c6f0d47758
5 changed files with 36 additions and 72 deletions

View File

@ -16,6 +16,7 @@ COMPONENT_ADD_LDFLAGS := -lbt -L $(COMPONENT_PATH)/controller/lib/esp32 \
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/controller/lib/esp32/lib%.a,$(LIBS))
COMPONENT_SUBMODULES += controller/lib
COMPONENT_ADD_LDFRAGMENTS += linker.lf
# TODO: annotate fallthroughs in Bluedroid code with comments

View File

@ -1,5 +1,40 @@
[sections:bss_common]
entries:
.bss+
COMMON
[scheme:bt_start_end]
entries:
bss_common -> dram0_bss
data -> dram0_data
# For the following fragments, order matters for
# 'align(4, post) emit(sym)', which generates:
#
# _sym_start
# ...
# . = ALIGN(4)
# _sym_end
[mapping:bt]
archive: libbt.a
entries:
* (bt_start_end);
bss_common -> dram0_bss align(4, post) emit(bt_bss),
data -> dram0_data align(4, post) emit(bt_data)
if ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y:
* (extram_bss)
[mapping:btdm]
archive: libbtdm_app.a
entries:
* (bt_start_end);
bss_common -> dram0_bss align(4, post) emit(btdm_bss),
data -> dram0_data align(4, post) emit(btdm_data)
[mapping:nimble]
archive: libnimble.a
entries:
* (bt_start_end);
bss_common -> dram0_bss align(4, post) emit(nimble_bss),
data -> dram0_data align(4, post) emit(nimble_data)

View File

@ -172,18 +172,6 @@ SECTIONS
.dram0.data :
{
_data_start = ABSOLUTE(.);
_bt_data_start = ABSOLUTE(.);
*libbt.a:(.data .data.*)
. = ALIGN (4);
_bt_data_end = ABSOLUTE(.);
_btdm_data_start = ABSOLUTE(.);
*libbtdm_app.a:(.data .data.*)
. = ALIGN (4);
_btdm_data_end = ABSOLUTE(.);
_nimble_data_start = ABSOLUTE(.);
*libnimble.a:(.data .data.*)
. = ALIGN (4);
_nimble_data_end = ABSOLUTE(.);
*(.gnu.linkonce.d.*)
*(.data1)
*(.sdata)
@ -234,18 +222,6 @@ SECTIONS
{
. = ALIGN (8);
_bss_start = ABSOLUTE(.);
_bt_bss_start = ABSOLUTE(.);
*libbt.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_bt_bss_end = ABSOLUTE(.);
_btdm_bss_start = ABSOLUTE(.);
*libbtdm_app.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_btdm_bss_end = ABSOLUTE(.);
_nimble_bss_start = ABSOLUTE(.);
*libnimble.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_nimble_bss_end = ABSOLUTE(.);
mapping[dram0_bss]

View File

@ -150,18 +150,6 @@ SECTIONS
.dram0.data :
{
_data_start = ABSOLUTE(.);
_bt_data_start = ABSOLUTE(.);
*libbt.a:(.data .data.*)
. = ALIGN (4);
_bt_data_end = ABSOLUTE(.);
_btdm_data_start = ABSOLUTE(.);
*libbtdm_app.a:(.data .data.*)
. = ALIGN (4);
_btdm_data_end = ABSOLUTE(.);
_nimble_data_start = ABSOLUTE(.);
*libnimble.a:(.data .data.*)
. = ALIGN (4);
_nimble_data_end = ABSOLUTE(.);
*(.gnu.linkonce.d.*)
*(.data1)
__global_pointer$ = . + 0x800;
@ -203,18 +191,6 @@ SECTIONS
{
. = ALIGN (8);
_bss_start = ABSOLUTE(.);
_bt_bss_start = ABSOLUTE(.);
*libbt.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_bt_bss_end = ABSOLUTE(.);
_btdm_bss_start = ABSOLUTE(.);
*libbtdm_app.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_btdm_bss_end = ABSOLUTE(.);
_nimble_bss_start = ABSOLUTE(.);
*libnimble.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_nimble_bss_end = ABSOLUTE(.);
mapping[dram0_bss]

View File

@ -181,18 +181,6 @@ SECTIONS
.dram0.data :
{
_data_start = ABSOLUTE(.);
_bt_data_start = ABSOLUTE(.);
*libbt.a:(.data .data.*)
. = ALIGN (4);
_bt_data_end = ABSOLUTE(.);
_btdm_data_start = ABSOLUTE(.);
*libbtdm_app.a:(.data .data.*)
. = ALIGN (4);
_btdm_data_end = ABSOLUTE(.);
_nimble_data_start = ABSOLUTE(.);
*libnimble.a:(.data .data.*)
. = ALIGN (4);
_nimble_data_end = ABSOLUTE(.);
*(.gnu.linkonce.d.*)
*(.data1)
*(.sdata)
@ -234,18 +222,6 @@ SECTIONS
. = ALIGN (8);
_bss_start = ABSOLUTE(.);
*(.ext_ram.bss*)
_bt_bss_start = ABSOLUTE(.);
*libbt.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_bt_bss_end = ABSOLUTE(.);
_btdm_bss_start = ABSOLUTE(.);
*libbtdm_app.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_btdm_bss_end = ABSOLUTE(.);
_nimble_bss_start = ABSOLUTE(.);
*libnimble.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_nimble_bss_end = ABSOLUTE(.);
mapping[dram0_bss]