From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13490 invoked by alias); 16 Apr 2018 20:14:39 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 13478 invoked by uid 89); 16 Apr 2018 20:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Apr 2018 20:14:38 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w3GKEaYu022901 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Apr 2018 13:14:36 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w3GKEZND022900; Mon, 16 Apr 2018 13:14:35 -0700 (PDT) (envelope-from sgk) Date: Mon, 16 Apr 2018 20:14:00 -0000 From: Steve Kargl To: "Ryan S. Elliott" Cc: Thomas Koenig , fortran@gcc.gnu.org Subject: Re: Darwin linker error "illegal text-relocation" with -shared Message-ID: <20180416201435.GA21886@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00086.txt.bz2 On Mon, Apr 16, 2018 at 02:51:16PM -0500, Ryan S. Elliott wrote: > > No, you are right. I should have included the -fPIC flag, but this doesn't > change the results: > > > $ gfortran-7 -shared -fPIC foo.f90 > ld: illegal text-relocation to '_gee' in /var/folders/q0/mth73zrd307d66c43f8r3xv80000gp/T//ccG1nHc0.o from 'lC0' in /var/folders/q0/mth73zrd307d66c43f8r3xv80000gp/T//ccG1nHc0.o for architecture x86_64 > collect2: error: ld returned 1 exit status > google 'macos ld illegal text-relocation' suggests that this is a longstanding problem with macos. Perhaps, a bug report to Apple is appropriate? Try adding "-Wl,-read_only_relocs suppress" to your command line. -- Steve