[committed,wwwdocs] gcc-11/changes: "used" attribute saves decls from linker garbage collection

Message ID 20201207145703.i6n72bc67bnw72hr@jozef-acer-manjaro
State New
Headers show
Series
  • [committed,wwwdocs] gcc-11/changes: "used" attribute saves decls from linker garbage collection
Related show

Commit Message

Jozef Lawrynowicz Dec. 7, 2020, 2:57 p.m.
Since 6fbec038f7a, the "used" attribute will save the symbol declaration
it is applied to from linker garbage collection, if the target supports
the SHF_GNU_RETAIN section flag.

This patch documents this functionality in the GCC 11 changes document.
Some users might need to amend their source code to handle the fact that
GCC can now place "used" decls in a new, unique section.

Committed as obvious.
From 7c56c86ebe102849ec239f0c57e93988169d90f4 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>

Date: Mon, 7 Dec 2020 14:41:13 +0000
Subject: [PATCH] gcc-11/changes: "used" attribute saves decls from linker
 garbage collection

---
 htdocs/gcc-11/changes.html | 12 ++++++++++++
 1 file changed, 12 insertions(+)

-- 
2.29.2

Comments

Gerald Pfeifer Dec. 14, 2020, 11:48 p.m. | #1
On Mon, 7 Dec 2020, Jozef Lawrynowicz wrote:
> Committed as obvious.


Thank you!

+  <li>
+    For ELF targets that support the GNU or FreeBSD OSABIs, the
+    <code>used</code> attribute will now save the symbol declaration it is
+    applied to from linker garbage collection.
+    <br>
+    To support this behavior, <code>used</code> symbols that have not
+    been placed in specific sections (e.g. with the <code>section</code>
+    attribute, or the <code>-f{function,data}-sections</code> options) will
+    be placed in new, unique sections.
+    <br>
+    This functionality requires Binutils version 2.36 or later.
+  </li>

Have you considered using <p>...</p> around the three blocks of
text instead of <br> in between?

An open question, it's okay to keep as is if you prefer.

Gerald
Jozef Lawrynowicz Dec. 15, 2020, 11:25 a.m. | #2
On Tue, Dec 15, 2020 at 12:48:47AM +0100, Gerald Pfeifer wrote:
> On Mon, 7 Dec 2020, Jozef Lawrynowicz wrote:

> > Committed as obvious.

> 

> Thank you!

> 

> +  <li>

> +    For ELF targets that support the GNU or FreeBSD OSABIs, the

> +    <code>used</code> attribute will now save the symbol declaration it is

> +    applied to from linker garbage collection.

> +    <br>

> +    To support this behavior, <code>used</code> symbols that have not

> +    been placed in specific sections (e.g. with the <code>section</code>

> +    attribute, or the <code>-f{function,data}-sections</code> options) will

> +    be placed in new, unique sections.

> +    <br>

> +    This functionality requires Binutils version 2.36 or later.

> +  </li>

> 

> Have you considered using <p>...</p> around the three blocks of

> text instead of <br> in between?

> 

> An open question, it's okay to keep as is if you prefer.


I did try with <p>...</p>, but I thought the additional line spacing
just looked a little out of place amongst all the other lines in this
section, which are list items so have compact line spacing. However,
since they are separate paragraphs there should be some formatting to
show this.

Also, I guess that using <br> to override the house style in this way is
a bit of a no-no, so I will change it to <p>...</p>.

Committed the attached patch.

Thanks,
Jozef
From fb048b7d45422cd869772462cba591a46f1b3b2f Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>

Date: Tue, 15 Dec 2020 11:19:41 +0000
Subject: [PATCH] gcc-11/changes: Use <p> instead of <br> for "used" attribute
 description

---
 htdocs/gcc-11/changes.html | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/htdocs/gcc-11/changes.html b/htdocs/gcc-11/changes.html
index ea9fe93c..1a9e72c1 100644
--- a/htdocs/gcc-11/changes.html
+++ b/htdocs/gcc-11/changes.html
@@ -159,16 +159,20 @@ a work-in-progress.</p>
     </ul>
   </li>
   <li>
+    <p>
     For ELF targets that support the GNU or FreeBSD OSABIs, the
     <code>used</code> attribute will now save the symbol declaration it is
     applied to from linker garbage collection.
-    <br>
+    </p>
+    <p>
     To support this behavior, <code>used</code> symbols that have not
     been placed in specific sections (e.g. with the <code>section</code>
     attribute, or the <code>-f{function,data}-sections</code> options) will
     be placed in new, unique sections.
-    <br>
+    </p>
+    <p>
     This functionality requires Binutils version 2.36 or later.
+    </p>
   </li>
 </ul>
 
-- 
2.29.2

Patch

diff --git a/htdocs/gcc-11/changes.html b/htdocs/gcc-11/changes.html
index ed289744..4d3efed5 100644
--- a/htdocs/gcc-11/changes.html
+++ b/htdocs/gcc-11/changes.html
@@ -158,6 +158,18 @@  a work-in-progress.</p>
       </li>
     </ul>
   </li>
+  <li>
+    For ELF targets that support the GNU or FreeBSD OSABIs, the
+    <code>used</code> attribute will now save the symbol declaration it is
+    applied to from linker garbage collection.
+    <br>
+    To support this behavior, <code>used</code> symbols that have not
+    been placed in specific sections (e.g. with the <code>section</code>
+    attribute, or the <code>-f{function,data}-sections</code> options) will
+    be placed in new, unique sections.
+    <br>
+    This functionality requires Binutils version 2.36 or later.
+  </li>
 </ul>
 
 <h3 id="cxx">C++</h3>