public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5822] doc: "used" attribute saves decls from linker garbage collection
@ 2020-12-07 14:28 Jozef Lawrynowicz
  0 siblings, 0 replies; only message in thread
From: Jozef Lawrynowicz @ 2020-12-07 14:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:724390745213d5192af04a51bb08cf44da7c396d

commit r11-5822-g724390745213d5192af04a51bb08cf44da7c396d
Author: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date:   Mon Dec 7 14:26:46 2020 +0000

    doc: "used" attribute saves decls from linker garbage collection
    
    gcc/ChangeLog:
    
            * doc/extend.texi (used function attribute): Document saving
            the declaration from linker garbage collection.
            (used variable attribute): Likewise.

Diff:
---
 gcc/doc/extend.texi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index fd282aa0157..0c969085d1f 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3859,6 +3859,14 @@ When applied to a member function of a C++ class template, the
 attribute also means that the function is instantiated if the
 class itself is instantiated.
 
+For ELF targets that support the GNU or FreeBSD OSABIs, this attribute
+will also save the function from linker garbage collection.  To support
+this behavior, functions that have not been placed in specific sections
+(e.g. by the @code{section} attribute, or the @code{-ffunction-sections}
+option), will be placed in new, unique sections.
+
+This additional functionality requires Binutils version 2.36 or later.
+
 @item visibility ("@var{visibility_type}")
 @cindex @code{visibility} function attribute
 This attribute affects the linkage of the declaration to which it is attached.
@@ -7420,6 +7428,14 @@ When applied to a static data member of a C++ class template, the
 attribute also means that the member is instantiated if the
 class itself is instantiated.
 
+For ELF targets that support the GNU or FreeBSD OSABIs, this attribute
+will also save the variable from linker garbage collection.  To support
+this behavior, variables that have not been placed in specific sections
+(e.g. by the @code{section} attribute, or the @code{-fdata-sections} option),
+will be placed in new, unique sections.
+
+This additional functionality requires Binutils version 2.36 or later.
+
 @item vector_size (@var{bytes})
 @cindex @code{vector_size} variable attribute
 This attribute specifies the vector size for the type of the declared


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-07 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 14:28 [gcc r11-5822] doc: "used" attribute saves decls from linker garbage collection Jozef Lawrynowicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).