From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2332 invoked by alias); 20 Apr 2005 03:35:41 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 2238 invoked from network); 20 Apr 2005 03:35:31 -0000 Received: from unknown (205.217.158.180) by sourceware.org with QMTP; 20 Apr 2005 03:35:31 -0000 Received: (qmail 22982 invoked by uid 10); 20 Apr 2005 03:35:31 -0000 Received: (qmail 28665 invoked by uid 500); 20 Apr 2005 03:35:22 -0000 Mail-Followup-To: binutils@sources.redhat.com, ebotcazou@adacore.com To: Eric Botcazou Cc: binutils@sources.redhat.com Subject: Re: Oddity in the linker code on AIX References: <200504192325.32716.ebotcazou@adacore.com> From: Ian Lance Taylor Date: Wed, 20 Apr 2005 03:35:00 -0000 In-Reply-To: <200504192325.32716.ebotcazou@adacore.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-04/txt/msg00535.txt.bz2 Eric Botcazou writes: > #ifdef ALIGN_SECTIONS_IN_FILE > if ((abfd->flags & EXEC_P) != 0) > { > /* Make sure this section is aligned on the right boundary - by > padding the previous section up if necessary. */ > > old_sofar = sofar; > #ifdef RS6000COFF_C > /* AIX loader checks the text section alignment of (vma - filepos) > So even though the filepos may be aligned wrt the o_algntext, for > AIX executables, this check fails. This shows up when a native > AIX executable is stripped with gnu strip because the default vma > of native is 0x10000150 but default for gnu is 0x10000140. Gnu > stripped gnu excutable passes this check because the filepos is > 0x0140. This problem also show up with 64 bit shared objects. The > data section must also be aligned. */ > if (!strcmp (current->name, _TEXT) > || !strcmp (current->name, _DATA)) > { > bfd_vma pad; > bfd_vma align; > > sofar = BFD_ALIGN (sofar, 1 << current->alignment_power); > > align = 1 << current->alignment_power; > pad = abs (current->vma - sofar) % align; > > if (pad) > { > pad = align - pad; > sofar += pad; > } > } > else > #else > { > sofar = BFD_ALIGN (sofar, 1 << current->alignment_power); > } > #endif It's pretty clear from looking at the original patch introducing this code: 2001-12-20 Tom Rix * coffcode.h (coff_compute_section_file_positions): Add special AIX loader alignment of text section. that the #else above should be a #endif, and the #endif should be removed. Ian