<div dir="ltr">This mailing list probably isn't suited to answer your question. <div><br></div><div>Perhaps the reddit reverseengineering community can help you with this, since what you ask is more concerned with data sections according to what is defined by source. </div><div><br></div><div>In any case, the size of the read only data section can be reverse engineered as it is on disk with something like CFF explorer, and you can estimate from what that returns what it will be in memory, which is usually the next highest page size multiple.</div><div><br></div><div>What is defined by source doesn't usually establish any strict correspondence as to what actually happens with the final binary, as since compilers span languages and decades of development it's unlikely that there's consistency in terms of where what will be placed or the name of the section or just about anything except the mere minimum that the OS needs in order to load and execute the result.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 19, 2015 at 4:19 AM, 慕冬亮 via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In C language programming, which content of variable will store in<br>
read-only data section?<br>
<br>
void func( int i ){<br>
    printf("%d\n", i);<br>
}<br>
<br>
int main()<br>
{<br>
    const str = "const string";<br>
    int b;<br>
<br>
    func(b);<br>
    return 0;<br>
}<br>
<br>
Look at the program before, what, I already know, will be stored in<br>
read-only data section is constant string like "const str = "const<br>
string"", jump table(switch ... case), printf/scanf fomat string like<br>
"%d\n".<br>
<br>
What do I miss? And for a ordinary application, what's the size of<br>
read-only data section?<br>
Is there any difference between GCC with LLVM about the content of<br>
read-only data section?<br>
<br>
Thanks in advance.<br>
    - mudongliang<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>