From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56943 invoked by alias); 13 Feb 2020 07:50:59 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 56931 invoked by uid 89); 13 Feb 2020 07:50:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=casner, digging, Casner, Stephen X-HELO: mail-pl1-f169.google.com Received: from mail-pl1-f169.google.com (HELO mail-pl1-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 07:50:57 +0000 Received: by mail-pl1-f169.google.com with SMTP id c23so2017686plz.4 for ; Wed, 12 Feb 2020 23:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sJZELAbmjnXcLg2Atauwxlx49TUSuxs+DQMkqbnc8vA=; b=sQbYjEsijA5SD89G7ATInJ4dbNBvG9cf+Z/dMQNwpvyhV5wOw8tu5nxE6JeCsbViAI YwEovJCOh1byHjWnsoOVJ3uUqPIU7rNs+oo1dVUxglaL4qbislvksorOnodPRpWYiTD6 xxpoEL9A0dkLPWmCQ7kSmb1O2kuwkgsQ+aFixyo1siTCIw7GczQesYN6VgeGl02pJg7e j3P5o7gDIABQgmWjYW/MZ8ZdKv9CIdFjAX4M8yebYeB0Lomj8EbYAvJz/qAevLXGccUG 8e70mVEC9Kd35ExvQDQqv+BmJky+Kqst804wUEJeJyF0gPLx5Go7SHU6qv1AI9pHb5/M rfQw== Return-Path: Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:f001:cc1f:fd45:a375]) by smtp.gmail.com with ESMTPSA id l1sm1622411pjb.28.2020.02.12.23.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 23:50:55 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D35CB8AD3B; Thu, 13 Feb 2020 18:20:51 +1030 (ACDT) Date: Thu, 13 Feb 2020 07:50:00 -0000 From: Alan Modra To: Stephen Casner Cc: binutils@sourceware.org Subject: Re: Problem with ld for PDP-11 Message-ID: <20200213075051.GE29647@bubble.grove.modra.org> References: <20200213002635.GA29647@bubble.grove.modra.org> <20200213065753.GD29647@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00245.txt.bz2 On Wed, Feb 12, 2020 at 11:18:50PM -0800, Stephen Casner wrote: > On Thu, 13 Feb 2020, Alan Modra wrote: > > > On Wed, Feb 12, 2020 at 10:02:02PM -0800, Stephen Casner wrote: > > > So now I went digging my way back through the code sequence using > > > printfs to find where the original data size gets rounded up. It > > > turns out that the size of the data section is always even because the > > > assembler "as" or "gas" always pads the data section with a zero byte > > > if the size is odd, so the object file header always contains an even > > > size for the .data section. That's because there is always relocation > > > and symbol information following it. > > > > > > Therefore the size of the .data section in ld is always even > > > > No, a linker script might contribute to .data output. > > Oh, that's something I don't know about. Can you point me to an > example so I can try it? You could use ld/ldscripts/pdp11.x (which is the default script you'll be using for normal executables), and add the line BYTE (0) after CONSTRUCTORS. Then link using -T. -- Alan Modra Australia Development Lab, IBM