diff --git a/components/bt/linker.lf b/components/bt/linker.lf index 72afd4d2e0..debff10af3 100644 --- a/components/bt/linker.lf +++ b/components/bt/linker.lf @@ -24,12 +24,13 @@ entries: [mapping:bt] archive: libbt.a entries: - * (bt_start_end); - bt_bss -> dram0_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_bss), - bt_common -> dram0_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_common), - data -> dram0_data ALIGN(4) ALIGN(4, post) SURROUND(bt_data) if ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y: * (extram_bss) + else: + * (bt_start_end); + bt_bss -> dram0_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_bss), + bt_common -> dram0_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_common), + data -> dram0_data ALIGN(4) ALIGN(4, post) SURROUND(bt_data) [mapping:btdm] archive: libbtdm_app.a diff --git a/tools/ldgen/ldgen/generation.py b/tools/ldgen/ldgen/generation.py index 2b67dec896..a2743e7424 100644 --- a/tools/ldgen/ldgen/generation.py +++ b/tools/ldgen/ldgen/generation.py @@ -471,7 +471,7 @@ class Generation: sections_str = get_section_strs(section) - key = (entity, section.name) + key = (entity, sections_str) try: existing = entity_mappings[key] diff --git a/tools/ldgen/test/test_generation.py b/tools/ldgen/test/test_generation.py index 2ccfd7d70b..086fad43fa 100755 --- a/tools/ldgen/test/test_generation.py +++ b/tools/ldgen/test/test_generation.py @@ -782,6 +782,31 @@ entries: with self.assertRaises(GenerationException): self.generation.generate(self.entities) + def test_same_entity_conflicting_section(self): + # Test same entity being mapped by scheme conflicting with another. + # + # custom_rtc = .text -> rtc_text + # noflash = .text -> iram0_text, .rodata -> dram0_data + # + # This operation should fail. + mapping = u""" +[sections:custom_text] +entries: + .text+ + .literal+ + +[scheme:custom_rtc] +entries: + custom_text -> rtc_text + +[mapping:test] +archive: libfreertos.a +entries: + croutine (noflash) #1 + croutine (custom_rtc) #2 +""" + self.test_same_entity_conflicting_scheme(mapping) + def test_complex_mapping_case(self, alt=None): # Test a complex case where an object is mapped using # one scheme, but a specific symbol in that object is mapped