<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3819.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman" size=2>
<DIV> </DIV>
<DIV>I mentioned a way which I used to grab the entry address of BB in previous
email for Andrew. As I said, there is a limitation. And I am not sure it can be
used for other cases.</DIV>
<DIV> </DIV>
<DIV>For my research code compression, my final goal is to improve the
performance and keep code size as small as possible.</DIV>
<DIV>Now, for the first step I want to code a program which can load and
run elf binary code. Here, I want to load binary code by BBs. Initially the
program will load the first BB in binary code ( entrance BB) and excute the
instructions in BB. Once the program hit the instruct which need jump or enter
another BB, it will load the mapped BB from binary code. And keep doing
it.</DIV>
<DIV> </DIV>
<DIV>I will create a table which record the entry address for each BB. Once the
BB has been loaded by pervious instruction, I don't need load it again.</DIV>
<DIV> </DIV>
<DIV>That is why I want to grab the entry address of each BB.</DIV>
<DIV> </DIV>
<DIV>Actually, I tried to use API ptrace to implement the program I mentioned.
It means I can set breakpionts at each entry of BB, once the program hits the
break point, I can use ptrace to load the next BB to memory. However, I
haven't done it by using ptrace. The reason is that I don't know how complex
process ptrace did. So I really want to write some assemble code or C to do
it if I can.</DIV>
<DIV> </DIV>
<DIV>If I can finish the first step, I will find some optimization method based
on BB to improve the performance. And then ....</DIV>
<DIV> </DIV>
<DIV>Is it clear for my project? :-)</DIV>
<DIV> </DIV>
<DIV>Thanks again.</DIV>
<DIV> </DIV>
<DIV>Qiuyu</DIV>
<DIV> </DIV>
<DIV>> On Mon, 20 Sep 2004, Zhang Qiuyu wrote:<BR>> <BR>> > I could
get the address information by the way you guys mentioned. But<BR>> > it
is not what I want, because it will lose information about the entry<BR>>
> of basic block. Actually what I want to get is the address of each
entry<BR>> > of basic block. Now I am trying to declare the label of basic
block as<BR>> > global type, hopefully I can get it from symbol table. Can
I get it by<BR>> > this way?<BR>> <BR>> I'm sure you could hack
something, by emitting a global symbol like we do<BR>> for functions, but
really, what are you trying to do? There is probably a<BR>> much better
and more robust way to do it. If you tell us what you're<BR>> trying to
actually accomplish (what you need the addresses of BB's for),<BR>> maybe we
can make a useful suggestion.<BR>> <BR>> -Chris<BR>> <BR>> --
<BR></DIV></FONT></DIV></BODY></HTML>