文字池太远? [英] Literal Pool too Distant?

查看:31
本文介绍了文字池太远?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Keil uVision 5 环境中的 Freescale Freedom KL46Z 板上用 ARM 汇编语言编写代码.我的代码很长,但在代码的主要部分,每当我尝试加载 (LDR) 常量或变量时,我都会收到此错误:错误:A1284E:文字池太远,使用LTORG将其组装在4KB以内我不知道这意味着什么或如何解决它.发生错误的地方都在类似的说明上.例如,第一个错误出现在一条指令上:LDR R1,=时间其中时间定义为:时空4该实例是一个变量,但它也发生在定义的常量上.谁能帮我弄清楚如何解决这个错误?

I'm writing code in ARM assembly language on the Freescale Freedom KL46Z board in the Keil uVision 5 environment. My code is quite lengthy, but in the main part of the code, whenever I try to load (LDR) a constant or variable, I get this error: error: A1284E: Literal pool too distant, use LTORG to assemble it within 4KB I have no idea what this means or how to fix it. The spots where the errors occur are all on similar instructions. For example, the first error is on an instruction that reads: LDR R1,=Time where Time is defined as: Time SPACE 4 That instance was a variable but it also happens on defined constants. Can anyone help me figure out how to fix this error?

推荐答案

错误消息或多或少说明了您需要做什么.将 LTORG 指令 插入您的汇编代码中的某处在给出错误消息的行的 4096 字节内.LTORG 语句必须与您的代码位于同一部分,并且不能位于可能被执行的代码路径上.这会导致将常量(文字)插入到会导致崩溃或在执行时出现其他错误行为的部分中.

The error message explains more or less what you need to do. Insert an LTORG directive into your assembly code somewhere within 4096 bytes of line giving the error message. The LTORG statement must be in the same section as your code and it must not be on a code path that might be executed. It results in the insertion of constants (literals) into the section that will cause a crash or otherwise misbehave if executed.

一个好的地方要么是在给出错误的函数结束之后(或在函数的入口标签之前).如果这仍然超过 4K,那么您需要在您的函数中找到一个无条件分支或返回指令,您可以将其放在后面.如果没有这样的指令,那么您将不得不插入一个无条件分支指令,该指令除了跳过代码中某处的 LTORG 语句外什么都不做.

A good place is either is after end of the function (or before the function's entry label) that gives the error. If that's still more than 4K away then you need to find an unconditional branch or return instruction in your function that you can put it after. If there's no such instruction, then you'll have to insert an unconditional branch instruction that does nothing but jumps over an LTORG statement somewhere in your code.

这篇关于文字池太远?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆