public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Stephen Casner <casner@acm.org>
Cc: binutils@sourceware.org
Subject: Re: Problem with ld for PDP-11
Date: Thu, 13 Feb 2020 07:50:00 -0000	[thread overview]
Message-ID: <20200213075051.GE29647@bubble.grove.modra.org> (raw)
In-Reply-To: <alpine.OSX.2.21.9999.2002122317290.48467@auge.attlocal.net>

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

  reply	other threads:[~2020-02-13  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 20:30 Stephen Casner
2020-02-13  0:26 ` Alan Modra
2020-02-13  6:02   ` Stephen Casner
2020-02-13  6:58     ` Alan Modra
2020-02-13  7:18       ` Stephen Casner
2020-02-13  7:50         ` Alan Modra [this message]
2020-02-14 23:42           ` Stephen Casner
2020-02-15  0:11   ` Stephen Casner
2020-02-17 21:06     ` Stephen Casner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213075051.GE29647@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=casner@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).