<div dir="ltr">Hi Tim,<br><br>Thanks for your helping. <br><br>> Not sure I follow. If you end up calling the appropriate EmitInt32 (or<br>> whatever) methods on the MCStreamer it should work for both assembly<br>> and object files.<br><br>I think I have misunderstood how *AsmPrinter works, is it not just `print' <br>assembly files, but also emit object files ?<br><br>> If you want to support disassembly reliably, you need to enhance your<br>> object format to describe where these constant islands are. On ARM,<br>> both MachO and ELF came to the same conclusion (though implemented it<br>> differently).<br>> You might want to borrow from the ARM ELF ABI (since it looks like<br>> you're targeting ELF):<br>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__infocenter.arm.com_help_topic_com.arm.doc.ihi0044e_IHI0044E-5Faaelf.pdf&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=K2GppaXGCK8Sf_USan-xrcDcoeb4yn5iCcrvJGGfpvw&s=S_aOQF6bpO2ydaVte9VkIUsBP8Jut3nbLosoHVyQ_6I&e=" target="_blank">http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf</a>.<br>> Search for "mapping symbols".<br><br>Sounds great, I'll check it out.<br><br>Cheers.<br>Huang<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 11:17 AM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Huang,<br>
<span class=""><br>
On 3 August 2015 at 19:03, zan jyu Wong <<a href="mailto:zyfwong@gmail.com">zyfwong@gmail.com</a>> wrote:<br>
> By the way, I have read the ARM backend, and know how it place<br>
> CONSTPOOL_ENTRY in basic block islands.<br>
<br>
</span>You've basically found the way out. ARMConstantIslands is the<br>
prototypical solution, and it's not pretty (to the extent that, even<br>
though AArch64 would support something similar as a possible<br>
optimisation, we've not implemented it due to the maintenance burden).<br>
<span class=""><br>
> However, I could not understand how to make it when emitting obj file.<br>
<br>
</span>Not sure I follow. If you end up calling the appropriate EmitInt32 (or<br>
whatever) methods on the MCStreamer it should work for both assembly<br>
and object files.<br>
<span class=""><br>
> And when the code & data are mixed, the<br>
> disassembler will failed to parse the binary properly.<br>
<br>
</span>If you want to support disassembly reliably, you need to enhance your<br>
object format to describe where these constant islands are. On ARM,<br>
both MachO and ELF came to the same conclusion (though implemented it<br>
differently).<br>
<br>
You might want to borrow from the ARM ELF ABI (since it looks like<br>
you're targeting ELF):<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__infocenter.arm.com_help_topic_com.arm.doc.ihi0044e_IHI0044E-5Faaelf.pdf&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=K2GppaXGCK8Sf_USan-xrcDcoeb4yn5iCcrvJGGfpvw&s=S_aOQF6bpO2ydaVte9VkIUsBP8Jut3nbLosoHVyQ_6I&e=" rel="noreferrer" target="_blank">http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf</a>.<br>
Search for "mapping symbols".<br>
<span class=""><br>
> For example, if we<br>
> place a CONSTPOOL_ENTRY in .text section and it will confused the<br>
> disassembler. I wonder if is possible to emit subsections (of .text section)<br>
> in *MCCodeEmitter to mix data into code and avoid confusing disassembler,<br>
> like this [1]?<br>
<br>
</span>I've not heard of subsections in ELF. Maybe you could come up with a<br>
scheme that would work, but I think it would be difficult.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>