From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2042) id A81663894C31; Mon, 7 Dec 2020 14:28:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A81663894C31 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jozef Lawrynowicz To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-5822] doc: "used" attribute saves decls from linker garbage collection X-Act-Checkin: gcc X-Git-Author: Jozef Lawrynowicz X-Git-Refname: refs/heads/master X-Git-Oldrev: ebdfd1606da6b5aa586b0cd156b69b659235c9c2 X-Git-Newrev: 724390745213d5192af04a51bb08cf44da7c396d Message-Id: <20201207142846.A81663894C31@sourceware.org> Date: Mon, 7 Dec 2020 14:28:46 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2020 14:28:46 -0000 https://gcc.gnu.org/g:724390745213d5192af04a51bb08cf44da7c396d commit r11-5822-g724390745213d5192af04a51bb08cf44da7c396d Author: Jozef Lawrynowicz 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