各位新進大家好, 我這邊有一個問題需要協助
我使用
1. 晶片:pic32mk1024mcm100
2. IDE版本: v6.05
3. complier版本: XC32 v4.10
我使用保留前段ram給classb以及blt pattern做使用
在一般使用不會報錯,但是使用debug就會跑出overlaps section:
section .shared VMA [0000000080000008,00000000800001ff] overlaps section reserve_data_0_kseg0 VMA [0000000080000000,000000008000036f]
我找不到"reserve_data_0_kseg0 "的實際定址的地方
以下是我修改的局部linker script:
MEMORY
{
...
SHARED (w!x) : ORIGIN = 0x80000008, LENGTH = 0x200 - 0x8
kseg0_data_mem (w!x) : ORIGIN = 0x80000400, LENGTH = 0x40000 - 0x400
...
}
/*************************************************************************
* Configuration-word sections. Map the config-pragma input sections to
* absolute-address output sections.
*************************************************************************/
SECTIONS
{
.shared (NOLOAD) :
{
. = ALIGN(4);
_sshared = .;
__shared_start__ = _sshared;
*(.shared)
*(.shared.*)
KEEP(*(.shared))
. = ALIGN(4);
_eshared = .;
__shared_end__ = _eshared;
} >SHARED
...
}
其他沒有變動的用"..."表示
以下是我覺得可能有overlap的section但我不確定是哪一個造成的:
SECTIONS
{
...
.dbg_data (NOLOAD) :
{
. += (DEFINED (_DEBUGGER) ? 0x200 : 0x0);
/* Additional data memory required for DSPr2 registers */
. += (DEFINED (_DEBUGGER) ? 0x80 : 0x0);
/* Additional data memory required for FPU64 registers */
. += (DEFINED (_DEBUGGER) ? 0x100 : 0x0);
} >kseg0_data_mem
.jcr :
{
KEEP (*(.jcr))
. = ALIGN(4) ;
} >kseg0_data_mem
.eh_frame : ONLY_IF_RW
{
KEEP (*(.eh_frame))
} >kseg0_data_mem
. = ALIGN(4) ;
.gcc_except_table : ONLY_IF_RW
{
*(.gcc_except_table .gcc_except_table.*)
} >kseg0_data_mem
. = ALIGN(4) ;
/* Persistent data - Use the new C 'persistent' attribute instead. */
.persist :
{
_persist_begin = .;
*(.persist .persist.*)
. = ALIGN(4) ;
_persist_end = .;
} >kseg0_data_mem
/*
* Note that input sections named .data* are not mapped here.
* The best-fit allocator locates them, so that they may flow
* around absolute sections as needed.
*/
.data :
{
*( .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
*(.data1)
. = ALIGN(4) ;
} >kseg0_data_mem
. = .;
_gp = ALIGN(16) + 0x7ff0;
.got ALIGN(4) :
{
*(.got.plt) *(.got)
. = ALIGN(4) ;
} >kseg0_data_mem /* AT>kseg0_program_mem */
/*
* Note that 'small' data sections are still mapped in the linker
* script. This ensures that they are grouped together for
* gp-relative addressing. Absolute sections are allocated after
* the 'small' data sections so small data cannot flow around them.
*/
/*
* We want the small data sections together, so single-instruction offsets
* can access them all, and initialized data all before uninitialized, so
* we can shorten the on-disk segment size.
*/
.sdata ALIGN(4) :
{
_sdata_begin = . ;
*(.sdata .sdata.* .gnu.linkonce.s.*)
. = ALIGN(4) ;
_sdata_end = . ;
} >kseg0_data_mem
.lit8 :
{
*(.lit8)
} >kseg0_data_mem
.lit4 :
{
*(.lit4)
} >kseg0_data_mem
. = ALIGN (4) ;
_data_end = . ;
_bss_begin = . ;
.sbss ALIGN(4) :
{
_sbss_begin = . ;
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
_sbss_end = . ;
. = ALIGN(4) ;
} >kseg0_data_mem
/*
* Align here to ensure that the .bss section occupies space up to
* _end. Align after .bss to ensure correct alignment even if the
* .bss section disappears because there are no input sections.
*
* Note that input sections named .bss* are no longer mapped here.
* The best-fit allocator locates them, so that they may flow
* around absolute sections as needed.
*
*/
.bss :
{
*(.dynbss)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(. != 0 ? 4 : 1);
} >kseg0_data_mem
. = ALIGN(4) ;
_end = . ;
_bss_end = . ;
/*
* The heap and stack are best-fit allocated by the linker after other
* data and bss sections have been allocated.
*/
/*
* RAM functions go at the end of our stack and heap allocation.
* Alignment of 2K required by the boundary register (BMXDKPBA).
*
* RAM functions are now allocated by the linker. The linker generates
* _ramfunc_begin and _bmxdkpba_address symbols depending on the
* location of RAM functions.
*/
_bmxdudba_address = LENGTH(kseg0_data_mem) ;
_bmxdupba_address = LENGTH(kseg0_data_mem) ;
/* The .pdr section belongs in the absolute section */
/DISCARD/ : { *(.pdr) }
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
.mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
.mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
.mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
.mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
.mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
.mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
.gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
.gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections used by MPLAB X for source-level debugging.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *.elf(.debug) *(.debug) }
.line 0 : { *.elf(.line) *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *.elf(.debug_srcinfo) *(.debug_srcinfo) }
.debug_sfnames 0 : { *.elf(.debug_sfnames) *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *.elf(.debug_aranges) *(.debug_aranges) }
.debug_pubnames 0 : { *.elf(.debug_pubnames) *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *.elf(.debug_info .gnu.linkonce.wi.*) *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *.elf(.debug_abbrev) *(.debug_abbrev) }
.debug_line 0 : { *.elf(.debug_line) *(.debug_line) }
.debug_frame 0 : { *.elf(.debug_frame) *(.debug_frame) }
.debug_str 0 : { *.elf(.debug_str) *(.debug_str) }
.debug_loc 0 : { *.elf(.debug_loc) *(.debug_loc) }
.debug_macinfo 0 : { *.elf(.debug_macinfo) *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *.elf(.debug_weaknames) *(.debug_weaknames) }
.debug_funcnames 0 : { *.elf(.debug_funcnames) *(.debug_funcnames) }
.debug_typenames 0 : { *.elf(.debug_typenames) *(.debug_typenames) }
.debug_varnames 0 : { *.elf(.debug_varnames) *(.debug_varnames) }
.debug_pubtypes 0 : { *.elf(.debug_pubtypes) *(.debug_pubtypes) }
.debug_ranges 0 : { *.elf(.debug_ranges) *(.debug_ranges) }
/DISCARD/ : { *(.rel.dyn) }
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
/DISCARD/ : { *(.note.GNU-stack) }
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.discard) }
}