public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Andreas Krebbel <krebbel@linux.ibm.com>, binutils@sourceware.org
Cc: amodra@gmail.com
Subject: Re: [PATCH] ld - Add SYMBOL_ABI_ALIGNMENT variable and apply to __bss_start
Date: Tue, 27 Jun 2023 15:14:56 +0100	[thread overview]
Message-ID: <312682e3-fc76-cac1-6d19-fb54c9ce0cf6@redhat.com> (raw)
In-Reply-To: <20230626091656.31782-1-krebbel@linux.ibm.com>

Hi Andreas,

> Currently not specific alignment is applied to the __bss_start
> symbol. However, on s390x we require every symbol to be on an even
> address.  The patch introduces a new variable for the elf.sc template
> which allows to specify such an symbol alignment requirement.

This patch looks good, but I see one issue - there are lot more symbols
provided by the elf.sc template than just __bss_start.  So if an ABI
requires symbols to be aligned, then that should apply to all symbols,
right ?

Actually there is one other thing.  Rather than doing:

    ${RELOCATING+. = ALIGN(${SYMBOL_ABI_ALIGNMENT});}
    ${RELOCATING+${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}__bss_start = .${CREATE_SHLIB+)};}

Wouldn't it make more sense to do:

    ${RELOCATING+${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}__bss_start = ALIGN (.${CREATE_SHLIB+), ${SYMBOL_ABI_ALIGNMENT});}

Ie making it clear that the alignment is being applied to the symbol.

It might even be possible to create a macro to do all of this
USER_LABEL_PREFIX and ALIGN munging, so that it does not have
to be repeated countless times in the elf.sc file.  I have not
actually checked to see if this is possible, but it would be
nice if it could be done.

Cheers
   Nick


  reply	other threads:[~2023-06-27 14:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  9:16 Andreas Krebbel
2023-06-27 14:14 ` Nick Clifton [this message]
2023-06-28  6:23   ` Andreas Krebbel
2023-07-04 12:18   ` [PATCH] Align linkerscript symbols according to ABI Andreas Krebbel
2023-07-05  9:44     ` Nick Clifton
2023-07-05  9:53       ` Andreas Krebbel
2023-07-07  3:03         ` Alan Modra
2023-07-07  9:38           ` Andreas Krebbel
2023-07-12  1:36             ` Alan Modra

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=312682e3-fc76-cac1-6d19-fb54c9ce0cf6@redhat.com \
    --to=nickc@redhat.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=krebbel@linux.ibm.com \
    /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).