From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: Nick Clifton <nickc@redhat.com>, Alan Modra <amodra@gmail.com>,
Michael Eager <eager@eagercon.com>
Subject: [PATCH 08/22] microblaze: drop/restrict override of .text, .data, and .bss
Date: Fri, 15 Dec 2023 13:11:36 +0100 [thread overview]
Message-ID: <3b9cf7bc-76dd-4cb1-9872-413ed5a62bab@suse.com> (raw)
In-Reply-To: <5e1fe3bc-78ca-4c54-a19c-f8efa015f839@suse.com>
While only ELF is supported right now, (stub) code generally is in place
for the non-ELF case as well. Don't override .bss for ELF - that's
unlikely to be a good idea anyway and prevented the sub-section
specifier from being usable. Don't override .text and .data at all - for
.data and ELF for the same reason, while for .text and ELF obj-elf.c's is
all we need, and for (hypothetical) non-ELF read.c's identical handling
would have been invoked anyway.
---
Wiring .bss to s_data() is somewhat odd, too.
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -135,27 +135,6 @@ microblaze_generate_symbol (char *sym)
/* Handle the section changing pseudo-ops. */
-static void
-microblaze_s_text (int ignore ATTRIBUTE_UNUSED)
-{
-#ifdef OBJ_ELF
- obj_elf_text (ignore);
-#else
- s_text (ignore);
-#endif
-}
-
-static void
-microblaze_s_data (int ignore ATTRIBUTE_UNUSED)
-{
-#ifdef OBJ_ELF
- obj_elf_change_section (".data", SHT_PROGBITS, SHF_ALLOC+SHF_WRITE,
- 0, 0, false);
-#else
- s_data (ignore);
-#endif
-}
-
/* Things in the .sdata segment are always considered to be in the small data section. */
static void
@@ -298,20 +277,13 @@ microblaze_s_rdata (int localvar)
}
static void
-microblaze_s_bss (int localvar)
+microblaze_s_sbss (int ignore ATTRIBUTE_UNUSED)
{
#ifdef OBJ_ELF
- if (localvar == 0) /* bss. */
- obj_elf_change_section (".bss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE,
- 0, 0, false);
- else if (localvar == 1)
- {
- /* sbss. */
- obj_elf_change_section (".sbss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE,
- 0, 0, false);
- if (sbss_segment == 0)
- sbss_segment = subseg_new (".sbss", 0);
- }
+ obj_elf_change_section (".sbss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE,
+ 0, 0, false);
+ if (sbss_segment == 0)
+ sbss_segment = subseg_new (".sbss", 0);
#else
s_data (ignore);
#endif
@@ -385,7 +357,6 @@ microblaze_s_weakext (int ignore ATTRIBU
const pseudo_typeS md_pseudo_table[] =
{
{"lcomm", microblaze_s_lcomm, 1},
- {"data", microblaze_s_data, 0},
{"data8", cons, 1}, /* Same as byte. */
{"data16", cons, 2}, /* Same as hword. */
{"data32", cons, 4}, /* Same as word. */
@@ -396,9 +367,10 @@ const pseudo_typeS md_pseudo_table[] =
{"rodata", microblaze_s_rdata, 0},
{"sdata2", microblaze_s_rdata, 1},
{"sdata", microblaze_s_sdata, 0},
- {"bss", microblaze_s_bss, 0},
- {"sbss", microblaze_s_bss, 1},
- {"text", microblaze_s_text, 0},
+#ifndef OBJ_ELF
+ {"bss", s_data, 0},
+#endif
+ {"sbss", microblaze_s_sbss, 0},
{"word", cons, 4},
{"frame", s_ignore, 0},
{"mask", s_ignore, 0}, /* Emitted by gcc. */
next prev parent reply other threads:[~2023-12-15 12:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 11:59 [PATCH 00/22] ELF: correct handling of simplified section directives Jan Beulich
2023-12-15 12:06 ` [PATCH 01/22] Arm: drop .bss override Jan Beulich
2023-12-15 12:06 ` [PATCH 02/22] Arm64: " Jan Beulich
2023-12-15 12:07 ` [PATCH 03/22] RISC-V: " Jan Beulich
2023-12-21 6:44 ` Nelson Chu
2023-12-15 12:08 ` [PATCH 04/22] IA64: " Jan Beulich
2023-12-15 12:09 ` [PATCH 05/22] bfin: " Jan Beulich
2023-12-15 12:10 ` [PATCH 06/22] m32c: " Jan Beulich
2023-12-15 12:10 ` [PATCH 07/22] m68k: " Jan Beulich
2023-12-15 12:11 ` Jan Beulich [this message]
2023-12-15 12:12 ` [PATCH 09/22] rl78: " Jan Beulich
2023-12-15 12:12 ` [PATCH 10/22] rx: " Jan Beulich
2023-12-15 12:13 ` [PATCH 11/22] s390: " Jan Beulich
2023-12-15 12:14 ` [PATCH 12/22] score: " Jan Beulich
2023-12-15 12:15 ` [PATCH 13/22] visium: drop .bss and .skip overrides Jan Beulich
2023-12-15 12:16 ` [PATCH 14/22] z80: drop .bss override Jan Beulich
2023-12-15 12:16 ` [PATCH 15/22] ELF: test certain .bss usages Jan Beulich
2023-12-15 12:16 ` [PATCH 16/22] gas: correct .bss documentation for non-ELF Jan Beulich
2023-12-15 12:17 ` [PATCH 17/22] v850: drop .bss override Jan Beulich
2023-12-15 12:18 ` [PATCH 18/22] d30v: fix .text/.data interaction with .previous Jan Beulich
2023-12-15 12:19 ` [PATCH 19/22] hppa/ELF: " Jan Beulich
2023-12-15 16:37 ` John David Anglin
2023-12-15 12:19 ` [PATCH 20/22] nios2: " Jan Beulich
2023-12-15 19:00 ` Sandra Loosemore
2023-12-15 12:20 ` [PATCH 21/22] pru: " Jan Beulich
2023-12-15 12:20 ` [PATCH 22/22] ELF: test certain .text/.data usages Jan Beulich
2024-01-02 0:40 ` [PATCH 00/22] ELF: correct handling of simplified section directives 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=3b9cf7bc-76dd-4cb1-9872-413ed5a62bab@suse.com \
--to=jbeulich@suse.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=eager@eagercon.com \
--cc=nickc@redhat.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).