From patchwork Fri Jul 11 15:04:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 369188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 95E7E14008D for ; Sat, 12 Jul 2014 01:05:03 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=C/3wBS0IkBWQ1bPz//iaNoFbdGDU/PPRd/1eVZx6Kja AdkMpK3kpUS80kUAiZt5KGtRL9BlB79U47a7fKGHMLw0HfbLpAsxwPPbMJrslELF fM1hbVvVrIK/C+NR7hYZckM1Eq29ol7r5fAaGbg9PElyhKkwcReqsxBhMTs2qc58 = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=IcUyWMJBvdRxTmJ4+Q6gxarmkas=; b=TP5HkAZYhXotcuGUl wzwIerWe3wn9fZNIuKZlBvzf102kzJ08Ct526I+ybRbFhjb9JgsYV/SmMhmgU5nb ptW0M8VZAh4GFmE/2Bx3D3Zw5wDpd9971eJW4E32iWdfZCTNaclyJPrzY2pdSV4O 3j1KC2kY4fNCV9Q/ZKVAbXTIpo= Received: (qmail 15932 invoked by alias); 11 Jul 2014 15:04:56 -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 15912 invoked by uid 89); 11 Jul 2014 15:04:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, SUBJ_ALL_CAPS autolearn=no version=3.3.2 X-HELO: mail-vc0-f177.google.com Received: from mail-vc0-f177.google.com (HELO mail-vc0-f177.google.com) (209.85.220.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 11 Jul 2014 15:04:52 +0000 Received: by mail-vc0-f177.google.com with SMTP id ij19so2253265vcb.22 for ; Fri, 11 Jul 2014 08:04:49 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.58.150.1 with SMTP id ue1mr51738826veb.11.1405091089826; Fri, 11 Jul 2014 08:04:49 -0700 (PDT) Received: by 10.220.11.5 with HTTP; Fri, 11 Jul 2014 08:04:49 -0700 (PDT) Date: Fri, 11 Jul 2014 11:04:49 -0400 Message-ID: Subject: [PATCH] AIX COMDAT From: David Edelsohn To: GCC Patches Cc: Jan Hubicka This patch enables COMDAT functionality on AIX. It defines MAKE_DECL_ONE_ONLY and removes the historical legacy link-line option of -bnodelcsect. -bnodelcsect instructs the AIX (garbage collecting) linker to preserve un-referenced CSECTs (like ELF sections). In the distant past, GCC emitted code that produced necessary sections that appeared not to be referenced, and the linker deleted them. GCC bootstraps and shows similar testsuite results with the patch. At this point, the patch needs wider use to find any problems. I plan to install the patch shortly. Thanks, David Bootstrapped on powerpc-ibm-aix7.1.0.0 * config/rs6000/aix51.h (LINK_SPEC): Remove -bnodelcsect. * config/rs6000/aix52.h (LINK_SPEC): Same. * config/rs6000/aix53.h (LINK_SPEC): Same. * config/rs6000/aix61.h (LINK_SPEC): Same. * config/rs6000/xcoff.h (MAKE_DECL_ONE_ONLY): Define. Index: aix53.h =================================================================== --- aix53.h (revision 212454) +++ aix53.h (working copy) @@ -133,7 +133,7 @@ %{pthread:-lpthreads} -lc" #undef LINK_SPEC -#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ +#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro}\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ %{mpe:-binitfini:poe_remote_main}" Index: aix51.h =================================================================== --- aix51.h (revision 212454) +++ aix51.h (working copy) @@ -121,7 +121,7 @@ %{pthread:-lpthreads} -lc" #undef LINK_SPEC -#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ +#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro}\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ %{mpe:-binitfini:poe_remote_main}" Index: xcoff.h =================================================================== --- xcoff.h (revision 212454) +++ xcoff.h (working copy) @@ -309,3 +309,6 @@ than in the .eh_frame section. We do this because the AIX linker would otherwise garbage collect these sections. */ #define EH_FRAME_IN_DATA_SECTION 1 + +#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) + Index: aix52.h =================================================================== --- aix52.h (revision 212454) +++ aix52.h (working copy) @@ -133,7 +133,7 @@ %{pthread:-lpthreads} -lc" #undef LINK_SPEC -#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ +#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro}\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ %{mpe:-binitfini:poe_remote_main}" Index: aix61.h =================================================================== --- aix61.h (revision 212454) +++ aix61.h (working copy) @@ -156,7 +156,7 @@ %{pthread:-lpthreads} -lc" #undef LINK_SPEC -#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ +#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro}\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ %{mpe:-binitfini:poe_remote_main}"