public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Paul Iannetta <piannetta@kalrayinc.com>
To: binutils@sourceware.org
Cc: Paul Iannetta <piannetta@kalrayinc.com>
Subject: [PATCH 2/4] kvx: fix handling of STB_GNU_UNIQUE symbols
Date: Wed, 23 Aug 2023 16:39:21 +0200	[thread overview]
Message-ID: <20230823143923.10105-3-piannetta@kalrayinc.com> (raw)
In-Reply-To: <20230823143923.10105-1-piannetta@kalrayinc.com>

When processing a STB_GNU_UNIQUE symbol we did not update has_gnu_osabi
correctly.

gas/ChangeLog:

2023-08-23  Paul Iannetta  <piannetta@kalrayinc.com>

	* config/tc-kvx.c (kvx_end): Do not write to e_ident.
	(kvx_type): Properly handle STB_GNU_UNIQUE symbols.
---
 gas/config/tc-kvx.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gas/config/tc-kvx.c b/gas/config/tc-kvx.c
index c5c8312922f..be8bc7da923 100644
--- a/gas/config/tc-kvx.c
+++ b/gas/config/tc-kvx.c
@@ -2205,7 +2205,6 @@ void
 kvx_end (void)
 {
   int newflags;
-  Elf_Internal_Ehdr *i_ehdrp;
 
   if (!env.params.core_set)
     env.params.core = kvx_core_info->elf_core;
@@ -2218,10 +2217,6 @@ kvx_end (void)
 
   bfd_set_private_flags (stdoutput, newflags);
 
-  i_ehdrp = elf_elfheader (stdoutput);
-  i_ehdrp->e_ident[EI_ABIVERSION] = env.params.abi;
-  i_ehdrp->e_ident[EI_OSABI] = env.params.osabi;
-
   cleanup ();
 
   if (inside_bundle && insncnt != 0)
@@ -2277,7 +2272,10 @@ kvx_type (int start ATTRIBUTE_UNUSED)
     type = BSF_ELF_COMMON;
   else if (strcmp (typename, "gnu_unique_object") == 0
 	   || strcmp (typename, "STB_GNU_UNIQUE") == 0)
-    type = BSF_OBJECT | BSF_GNU_UNIQUE;
+    {
+      elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_unique;
+      type = BSF_OBJECT | BSF_GNU_UNIQUE;
+    }
   else if (strcmp (typename, "notype") == 0
 	   || strcmp (typename, "STT_NOTYPE") == 0)
     ;
-- 
2.35.1.500.gb896f729e2






  parent reply	other threads:[~2023-08-23 14:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 16:01 [PATCH] kvx: fix 32-bit build and validation Paul Iannetta
2023-08-23  0:27 ` Alan Modra
2023-08-23  7:44   ` Paul Iannetta
2023-08-23 12:14     ` Alan Modra
2023-08-23 14:39       ` [PATCH 0/4] kvx: various fixes Paul Iannetta
2023-08-23 14:39         ` [PATCH 1/4] kvx: remove kvx_elf64_linux_vec Paul Iannetta
2023-08-23 14:39         ` Paul Iannetta [this message]
2023-08-23 14:39         ` [PATCH 3/4] kvx: use {u,}int32_t and {u,}int64_t Paul Iannetta
2023-08-23 14:39         ` [PATCH 4/4] kvx: bfd/config.bfd & ld/configure.tgt Paul Iannetta
2023-08-24  3:12         ` [PATCH 0/4] kvx: various fixes Alan Modra
2023-08-24  6:26           ` Paul Iannetta
2023-08-24  8:49           ` [PATCH] kvx: fix kvx_reassemble_bundle index 8 out of bounds Paul Iannetta
2023-08-24  9:08             ` Alan Modra
2023-08-24  9:26               ` Paul Iannetta
2023-09-07 12:46                 ` Alan Modra
2023-09-07 15:27                   ` Paul Iannetta
2023-08-23 14:40       ` [PATCH] kvx: fix 32-bit build and validation Paul Iannetta
2023-08-23  3:16 ` Alan Modra
2023-08-23 13:39   ` Luis Machado

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=20230823143923.10105-3-piannetta@kalrayinc.com \
    --to=piannetta@kalrayinc.com \
    --cc=binutils@sourceware.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).