Gcc 在Microblaze/OVPsim上访问半托管

Gcc 在Microblaze/OVPsim上访问半托管,gcc,linker,microblaze,ovp,Gcc,Linker,Microblaze,Ovp,我正在为OVPsim上的Microblaze编写代码,我想知道是否可以将半托管与我自己的链接器脚本和分页方案一起使用,即不使用crt0 我已经使用semihosting构建了我的平台,但是当我的程序集点击global.exit时-什么都没有发生-代码示例如下: handle_datatlb_miss: nop .global exit exit: ori r19, r0, clock_sweep_pte 我理解这应该被半宿主自动捕获,并导致模拟结束 我将自己的链接器脚本与自己的

我正在为OVPsim上的Microblaze编写代码,我想知道是否可以将半托管与我自己的链接器脚本和分页方案一起使用,即不使用crt0

我已经使用semihosting构建了我的平台,但是当我的程序集点击global.exit时-什么都没有发生-代码示例如下:

handle_datatlb_miss:
    nop
.global exit
exit:
    ori r19, r0, clock_sweep_pte
我理解这应该被半宿主自动捕获,并导致模拟结束

我将自己的链接器脚本与自己的makefile一起使用:

SECTIONS
{
    . = 0x0000;
    .vectors.reset : { *(.vectors.reset) }
    . = 0x0008;
    .vectors.sw_exception : { *(.vectors.sw_exception) }
    . = 0x0010;
    .vectors.interrupt : { *(.vectors.interrupt) }
    .= 0x0018;
    .vectors.breakpoint : { *(.vectors.breakpoint) }
    . = 0x0020;
    .vectors.hw_exception : { *(.vectors.hw_exception) }
    .text : { *(.text) }
    .data : { *(.data) }
    .bss : { *(.bss) }
}
如果删除链接器脚本,则代码不会使用OVP提供的生成文件进行编译,该文件适合于生成代码:

adrian@hairyirakli:~/Imperas/mb_boot$ make -f alt-makefile 
Linking Application startup.MICROBLAZE.elf
/home/adrian/Imperas/Imperas.20140731/lib/Linux32/CrossCompiler/microblaze-elf/bin/mb-ld: section .text [00000050 -> 0010a27b] overlaps section .vectors.hw_exception [00000020 -> 0000011f]
/home/adrian/Imperas/Imperas.20140731/lib/Linux32/CrossCompiler/microblaze-elf/bin/mb-ld: startup.MICROBLAZE.elf: section .text lma 0x50 overlaps previous sections
/home/adrian/Imperas/Imperas.20140731/lib/Linux32/CrossCompiler/microblaze-elf/bin/mb-ld: startup.MICROBLAZE.elf: section .vectors.breakpoint lma 0x10a27c overlaps previous sections
make: *** [startup.MICROBLAZE.elf] Error 1
当我使用它时,无论是我自己的makefile还是OVP提供的makefile,代码都会编译,但我似乎无法访问semihosting

我可以不使用crt0和其他工具访问半托管吗

更新

这就是我的代码的开头看起来的样子

_start:
brai _actualstart
.end _start
.section .vectors.sw_exception, "ax"
.align 2
_vector_sw_exception:
brai _exception_handler
.section .vectors.interrupt, "ax"
.align 2
_vector_interrupt:
brai _interrupt_handler
.section .vectors.breakpoint, "ax"
.align 2
_vector_breakpoint:
brai _handle_breakpoint
.section .vectors.hw_exception, "ax"
.align 2
_vector_hw_exception:
brai _hw_exception_handler

您可以在

中看到链接器的所有错误消息,这些消息看起来令人担忧:。。。重叠部分.vectors.hw_异常[00000020->0000011f]。看起来您将整个h/w异常和中断处理程序放入了.vectors.hw_异常和.vectors.interrupt部分。你应该把它放在胸罩上;并将处理程序保留在.text中。向量。*节不应超过8字节。我已经这样做了,我想。。。如果我能解决如何将代码放入注释中,我会把它放在这里,但我不能,所以我将编辑Opu,因为我无法在Linux上使用Xilinx'和原始GCC交叉编译器重现链接器错误,我没有OVP工具链。按预期编译。在.ld文件中未发现任何问题。makefile看起来也正常。无法判断这是否会影响半托管,但链接器错误看起来很奇怪。我修复了链接器错误-我在.text部分外有一个.org行。不幸的是,这并不能解决我的半托管问题。