From: Alan Modra <amodra@gmail.com>
To: Andreas Krebbel <krebbel@linux.ibm.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] Align linkerscript symbols according to ABI
Date: Wed, 12 Jul 2023 11:06:14 +0930 [thread overview]
Message-ID: <ZK4Djms7bRKb1+LO@squeak.grove.modra.org> (raw)
In-Reply-To: <d113cf4b-57dc-958d-ad26-de92555e66bc@linux.ibm.com>
Align dot before symbols defined outside of output sections. Before _end
is already aligned.
I'm inclined to think that with this patch the alignment in def_symbol
ought to disappear, but for now I'm leaving it in.
* scripttempl/elf.sc (def_symbol): Tidy excess space.
(_edata): Align before emitting symbol when SYMBOL_ABI_ALIGNMENT.
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 9e95e6b4162..bfd8b5ed4b3 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -171,7 +171,7 @@ fi
def_symbol()
{
if [ -z "${SYMBOL_ABI_ALIGNMENT}" ]; then
- echo "${USER_LABEL_PREFIX}$1 = . "
+ echo "${USER_LABEL_PREFIX}$1 = ."
else
echo "${USER_LABEL_PREFIX}$1 = ALIGN(${SYMBOL_ABI_ALIGNMENT})"
fi
@@ -688,6 +688,7 @@ cat <<EOF
${SDATA_GOT+${OTHER_GOT_SECTIONS}}
${DATA_SDATA-${SDATA}}
${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
+ ${RELOCATING+${SYMBOL_ABI_ALIGNMENT+. = ALIGN(${SYMBOL_ABI_ALIGNMENT});}}
${RELOCATING+${DATA_END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}$(def_symbol "_edata")${CREATE_SHLIB+)}; PROVIDE ($(def_symbol "edata"));}}
${PERSISTENT}
${RELOCATING+. = .;}
--
Alan Modra
Australia Development Lab, IBM
prev parent reply other threads:[~2023-07-12 1:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 9:16 [PATCH] ld - Add SYMBOL_ABI_ALIGNMENT variable and apply to __bss_start Andreas Krebbel
2023-06-27 14:14 ` Nick Clifton
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 [this message]
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=ZK4Djms7bRKb1+LO@squeak.grove.modra.org \
--to=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).