<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div>
<p>Thanks Reid/Jonathon for your replies.</p>
<p><br>
</p>
<p>Reid, <br>
</p>
<p>An important case against module level flags is that it wont allow changing or  resetting section names e.g.</p>
<p><br>
</p>
<p>int a;</p>
<p>#pragma clang section bss = "xyz"</p>
<p>int b;</p>
<p><br>
</p>
<p>In case above, users would like to see only 'b' placed in 'xyz' and not 'a' as well.<br>
</p>
<p>Link pointed to by Jonathon seems to require same behavior. <br>
</p>
<p><br>
</p>
<p>Jonathon,</p>
<p>We are happy to revise the spelling to -<br>
</p>
<p>#pragma clang section bss = "xyz" <br>
</p>
<p>as you propose.</p>
Best Regards, Javed.</div>
<font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b><br>
</b></font>
<p></p>
<p><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Jonathan Roelofs <jonathan@codesourcery.com></font><br>
</p>
<div dir="ltr">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Sent:</b> 13 March 2017 18:12:57<br>
<b>To:</b> James Molloy; Reid Kleckner; Javed Absar<br>
<b>Cc:</b> LLVM Dev; nd; cfe-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] [cfe-dev] proposal - pragma section directive in clang</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText"><br>
<br>
On 3/10/17 2:47 AM, James Molloy via llvm-dev wrote:<br>
> +llvm-dev properly this time.<br>
><br>
> On Fri, 10 Mar 2017 at 09:42 James Molloy <james@jamesmolloy.co.uk<br>
> <<a href="mailto:james@jamesmolloy.co.uk">mailto:james@jamesmolloy.co.uk</a>>> wrote:<br>
><br>
<br>
><br>
>     The documentation is here:<br>
>     <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472m/chr1359124985290.html">
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472m/chr1359124985290.html</a><br>
><br>
>     ** Proposed syntax and (vague) semantics **<br>
><br>
>     As this is a new pragma for Clang and isn't ARM-specific, we've<br>
>     invented a less ARM-specific syntax. Bikeshedding is expected and<br>
>     welcome.<br>
><br>
>       #pragma clang section bss(".mybss") rodata(".myrodata")<br>
>     data(".mydata") text(".mytext")<br>
<br>
There's some prior art in the GreenHills compiler too, where the example <br>
above would be spelled:<br>
<br>
     #pragma ghs section bss=".mybss", rodata=".myrodata", <br>
data=".mydata", text=".mytext"<br>
<br>
Maybe it's worth using that syntax, i.e:<br>
<br>
     #pragma clang section bss=".mybss", rodata=".myrodata", <br>
data=".mydata", text=".mytext"<br>
<br>
Alternatively, supporting vendor-specific spellings might be useful, if <br>
there's a consistency argument to be made for clang doing it its own way.<br>
<br>
Docs are pages 108/109 here:<br>
<a href="http://www.ece.ualberta.ca/~cmpe490/documents/ghs/build_arm.pdf">http://www.ece.ualberta.ca/~cmpe490/documents/ghs/build_arm.pdf</a><br>
<br>
<br>
Jon<br>
<br>
><br>
>     The pragma applies to all global variable and function declarations<br>
>     from the pragma to the end of the translation unit. The pragma<br>
>     should ideally be pushable and poppable, but that is outside the<br>
>     scope of this RFC. The pragma also applies to static local<br>
>     declarations within functions.<br>
><br>
>     All global variables and functions affected by this pragma have<br>
>     their default ELF section destinations changed. Globals with<br>
>     __attribute__((section())) are not affected (the attribute trumps<br>
>     the pragma).<br>
><br>
>     This pragma is only defined to work sensibly for ELF targets.<br>
><br>
<br>
<br>
-- <br>
Jon Roelofs<br>
jonathan@codesourcery.com<br>
CodeSourcery / Mentor Embedded<br>
</div>
</span></font></div>
</body>
</html>