From patchwork Mon Oct 16 05:59:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 826137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-464235-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="r34cuXRa"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFnj450rhz9s7m for ; Mon, 16 Oct 2017 16:59:50 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; q=dns; s=default; b=LERTcZs46j68sTP HWL4ec2aQSKeMSGP7NP4iFl/5cQTrAbjeEPQ3CahJk3tT6/oB1FWdieB7P1MRQJb jwN0jZFSZVYcRoAyqqgWCI7V0+GVT/GlyQcfhcOnjUrX1OoR6/et9KpjOAzxzhs8 HXuUsyqiP8XrLZDCPuhN4syfqQvE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; s=default; bh=9XrZ56WcCqUmwSjSEJeuk 1MC4OI=; b=r34cuXRah8+MSe+jEiQUS+AEpLGWGhUuN+oEyzNwX19vmcrUo2eBl 9Ykas2EkZRyHvh2bmFlrdknCMvMf1KGxWvDHwBlTFalKQc1hWf+mwQv14ZRWm9CZ QIe//OAqQzmkqX9le8hxxMrpIShEyh23OE5mWi7lnyf3V4h/+bk7Pc= Received: (qmail 51957 invoked by alias); 16 Oct 2017 05:59:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 51920 invoked by uid 89); 16 Oct 2017 05:59:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Together, quality X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Oct 2017 05:59:37 +0000 Received: from [88.198.220.132] (helo=sslproxy03.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1e3yR3-0005h9-9s for gcc-patches@gcc.gnu.org; Mon, 16 Oct 2017 07:59:33 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy03.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e3yR2-0000hJ-SL for gcc-patches@gcc.gnu.org; Mon, 16 Oct 2017 07:59:33 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 5F73B2A0A9D for ; Mon, 16 Oct 2017 07:59:34 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vOXxaIioxzdU for ; Mon, 16 Oct 2017 07:59:34 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 18C172A1678 for ; Mon, 16 Oct 2017 07:59:34 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 497A5pfaNAG2 for ; Mon, 16 Oct 2017 07:59:34 +0200 (CEST) Received: from linux-diu0.suse (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id E78D42A0A9D for ; Mon, 16 Oct 2017 07:59:33 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Subject: [PATCH] Update -ffunction/data-sections documentation Date: Mon, 16 Oct 2017 07:59:31 +0200 Message-Id: <20171016055931.30079-1-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes gcc/ * invoke.texi (ffunction-sections and fdata-sections): Update. --- gcc/doc/invoke.texi | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4e7dfb33c31..7bc051a1fc5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9712,18 +9712,26 @@ file if the target supports arbitrary sections. The name of the function or the name of the data item determines the section's name in the output file. -Use these options on systems where the linker can perform optimizations -to improve locality of reference in the instruction space. Most systems -using the ELF object format and SPARC processors running Solaris 2 have -linkers with such optimizations. AIX may have these optimizations in -the future. - -Only use these options when there are significant benefits from doing -so. When you specify these options, the assembler and linker -create larger object and executable files and are also slower. -You cannot use @command{gprof} on all systems if you -specify this option, and you may have problems with debugging if -you specify both this option and @option{-g}. +Use these options on systems where the linker can perform optimizations to +improve locality of reference in the instruction space. Most systems using the +ELF object format have linkers with such optimizations. On AIX, the linker +rearranges sections (CSECTs) based on the call graph. The performance impact +varies. + +Together with a linker garbage collection (linker @option{--gc-sections} +option) these options may lead to smaller statically linked executables (after +stripping). + +On ELF/DWARF systems these options do not degenerate the quality of the debug +information. There could be issues with other object files/debug info formats. + +Only use these options when there are significant benefits from doing so. When +you specify these options, the assembler and linker create larger object and +executable files and are also slower. These options affect code generation. +They prevent optimzations by the compiler and assembler using relative +locations inside a translation unit since the locations are unknown until +link-time. An examples for such an optimization is a call to short call +relaxation. @item -fbranch-target-load-optimize @opindex fbranch-target-load-optimize