public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix ELF section changing for .struct
@ 2006-07-13 12:26 Thiemo Seufer
  2006-07-15 12:18 ` Alan Modra
  2006-07-17  8:10 ` Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Thiemo Seufer @ 2006-07-13 12:26 UTC (permalink / raw)
  To: binutils

Hello All,

this patch handles ELF section changing for .struct directives.
Ok to apply?


Thiemo


2006-07-13  Thiemo Seufer  <ths@mips.com>
            David Ung  <davidu@mips.com>

	* read.c (s_struct): Handle ELF section changing.

Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.117
diff -u -p -r1.117 read.c
--- gas/read.c	7 Jun 2006 11:27:57 -0000	1.117
+++ gas/read.c	13 Jul 2006 11:00:25 -0000
@@ -3132,6 +3132,12 @@ s_struct (int ignore ATTRIBUTE_UNUSED)
   if (flag_mri)
     stop = mri_comment_field (&stopc);
   abs_section_offset = get_absolute_expression ();
+#ifdef OBJ_ELF
+  /* The ELF backend needs to know that we are changing sections, so
+     that .previous works correctly. */
+  if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+    obj_elf_section_change_hook ();
+#endif
   subseg_set (absolute_section, 0);
   demand_empty_rest_of_line ();
   if (flag_mri)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix ELF section changing for .struct
  2006-07-13 12:26 [PATCH] Fix ELF section changing for .struct Thiemo Seufer
@ 2006-07-15 12:18 ` Alan Modra
  2006-07-17  8:10 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Modra @ 2006-07-15 12:18 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

On Thu, Jul 13, 2006 at 01:25:22PM +0100, Thiemo Seufer wrote:
> this patch handles ELF section changing for .struct directives.

You want #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
OK with that change.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix ELF section changing for .struct
  2006-07-13 12:26 [PATCH] Fix ELF section changing for .struct Thiemo Seufer
  2006-07-15 12:18 ` Alan Modra
@ 2006-07-17  8:10 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2006-07-17  8:10 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

It would be nice if you used IS_ELF instead of OUTPUT_FLAVOR == bfd_target_elf_flavour. Jan

>>> Thiemo Seufer <ths@networkno.de> 13.07.06 14:25 >>>
Hello All,

this patch handles ELF section changing for .struct directives.
Ok to apply?


Thiemo


2006-07-13  Thiemo Seufer  <ths@mips.com>
            David Ung  <davidu@mips.com>

	* read.c (s_struct): Handle ELF section changing.

Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.117
diff -u -p -r1.117 read.c
--- gas/read.c	7 Jun 2006 11:27:57 -0000	1.117
+++ gas/read.c	13 Jul 2006 11:00:25 -0000
@@ -3132,6 +3132,12 @@ s_struct (int ignore ATTRIBUTE_UNUSED)
   if (flag_mri)
     stop = mri_comment_field (&stopc);
   abs_section_offset = get_absolute_expression ();
+#ifdef OBJ_ELF
+  /* The ELF backend needs to know that we are changing sections, so
+     that .previous works correctly. */
+  if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+    obj_elf_section_change_hook ();
+#endif
   subseg_set (absolute_section, 0);
   demand_empty_rest_of_line ();
   if (flag_mri)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-17  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 12:26 [PATCH] Fix ELF section changing for .struct Thiemo Seufer
2006-07-15 12:18 ` Alan Modra
2006-07-17  8:10 ` Jan Beulich

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