public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Set proper union selector tag
@ 2023-03-27 11:28 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-03-27 11:28 UTC (permalink / raw)
  To: binutils

	* coff-bfd.c (bfd_coff_get_auxent): After converting sym pointer
	to an index, reset the union tag.

diff --git a/bfd/coff-bfd.c b/bfd/coff-bfd.c
index 068ecebc8df..9660b6b14e5 100644
--- a/bfd/coff-bfd.c
+++ b/bfd/coff-bfd.c
@@ -82,19 +82,28 @@ bfd_coff_get_auxent (bfd *abfd,
   *pauxent = ent->u.auxent;
 
   if (ent->fix_tag)
-    pauxent->x_sym.x_tagndx.l =
-      ((combined_entry_type *) pauxent->x_sym.x_tagndx.p
-       - obj_raw_syments (abfd));
+    {
+      pauxent->x_sym.x_tagndx.l =
+	((combined_entry_type *) pauxent->x_sym.x_tagndx.p
+	 - obj_raw_syments (abfd));
+      ent->fix_tag = 0;
+    }
 
   if (ent->fix_end)
-    pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l =
-      ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p
-       - obj_raw_syments (abfd));
+    {
+      pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l =
+	((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p
+	 - obj_raw_syments (abfd));
+      ent->fix_end = 0;
+    }
 
   if (ent->fix_scnlen)
-    pauxent->x_csect.x_scnlen.l =
-      ((combined_entry_type *) pauxent->x_csect.x_scnlen.p
-       - obj_raw_syments (abfd));
+    {
+      pauxent->x_csect.x_scnlen.l =
+	((combined_entry_type *) pauxent->x_csect.x_scnlen.p
+	 - obj_raw_syments (abfd));
+      ent->fix_scnlen = 0;
+    }
 
   return true;
 }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-27 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 11:28 Set proper union selector tag Alan Modra

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).