注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

路雷米的博客

人生最难的就是在热爱和生计之间做选择, 愿每个人这一生 既对得起梦想又担得责任

 
 
 

日志

 
 

Aarch32与Aarch64 code可以link到一起吗?  

2014-03-10 17:49:36|  分类: ARM基础知识 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

[摘自ARM INFOCENTER]

Can AArch32 and AArch64 objects be linked together?

答案:

Objects built for AArch32 and AArch64 cannot be linked together.  This is because the two execution states use different ABIs, and different address widths.  The error message you will get from the ARM linker (armlink) will be similar to this:

Error: L6831E: Mixing machine types EM_ARM and EM_AARCH64 is not permitted.

This is not expected to be a common use case, as execution state (AArch32/AArch64) can only change when taking or returning from an exception.  So AArch32 code cannot directly call AArch64 code (or vice verse).

There are some cases where it is useful to build a mixed image.  In such cases there are a number of options:

(但在某些条件下:是可以做到的)

(1) DCI

The ARM assembler (armasm) provides the DCI directive.  This allows an instruction to be specified as hex value.  DCIs are not checked for validity against the target processor/instruction set.  Using DCIs would allow you to include A64 opcodes in an A32/T32 image, or A32/T32 opcodes in an A64 image.

This approach is useful when you only wish to include a short sequence in the other instruction set.  For example, a basic A64 boot strap which set up EL1 as AArch32 and switched to that exception level.


(2) INCBIN

The INCBIN directive allows a file to be included within an object as binary data.  This directive can be used to insert one image within another.  For example, an AArch64 boot loader program could include an AArch32 OS image as a binary.


(3)Symdef File

In some cases you may only need address information to be shared between two images.  For example, the address of shared data.  The ARM linker (armlink) can generate a symbols definition file (symdef file) listing the global symbols defined by the image, and their addresses.  This file can be used as an input to other link steps, with the linker using the file to resolve references to those symbols.

  评论这张
 
阅读(653)| 评论(0)

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018