[LLVMbugs] [Bug 9582] New: ARM/Thumb/Data mapping symbols not being generated
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Mar 29 08:36:52 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=9582
Summary: ARM/Thumb/Data mapping symbols not being generated
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: ARM
AssignedTo: unassignedbugs at nondot.org
ReportedBy: rengolin at gmail.com
CC: llvmbugs at cs.uiuc.edu
ARM mapping symbols (AAELF 4.6.5) are nor being generated in ELF output, so
disassemblers think that the section is code when it actually is data or vice
versa. Worse than that, linker optimizations could mistakenly put code in data
sections.
Example: LLVM is generating the following code:
main
0x000081f4: e92d4070 p at -. PUSH {r4-r6,lr}
0x000081f8: eb000010 .... BL _Z2g_v ; 0x8240
0x000081fc: e59f402c , at .. LDR r4,[pc,#44] ; [0x8230] = 0xad99
0x00008200: e59f6030 0`.. LDR r6,[pc,#48] ; [0x8238] = 0xad95
0x00008204: e59f5028 (P.. LDR r5,[pc,#40] ; [0x8234] = 0xad92
(...)
0x0000822c: e12fff1e ../. BX lr
0x00008230: 0000ad99 .... MULEQ r0,r9,sp ; ? SBZ = 0xa000
0x00008234: 0000ad92 .... MULEQ r0,r2,sp ; ? SBZ = 0xa000
0x00008238: 0000ad95 .... MULEQ r0,r5,sp ; ? SBZ = 0xa000
0x0000823c: 0000ad70 p... ANDEQ r10,r0,r0,ROR sp
Everything after the BX is obviously data, so the mapping symbol $d should have
been emitted after BX. The disassembler is clearly confused.
A mapping symbol $a, $t and $t has to be emitted before every ARM, Thumb and
Data block, respectively. Basically, the logic is simple: emit the correct
symbol whenever the next word has a different type of the previous.
See AAELF section 4.6.5 for more details at:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044c/IHI0044C_aaelf.pdf
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list