public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Handle 8-bit data relocations on sparc.
@ 2011-11-17  4:26 David Miller
  0 siblings, 0 replies; only message in thread
From: David Miller @ 2011-11-17  4:26 UTC (permalink / raw)
  To: binutils


The dwarf2 assembler test cases in gdb do things like this:

	.byte	2f - 1f

and this wasn't being handled by GAS on sparc.

Committed to trunk.

gas/

	* config/tc-sparc.c (md_apply_fix): Handle BFD_RELOC_8.

diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 77fda56..f453733 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -3193,8 +3193,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
 
   /* If this is a data relocation, just output VAL.  */
 
-  if (fixP->fx_r_type == BFD_RELOC_16
-      || fixP->fx_r_type == BFD_RELOC_SPARC_UA16)
+  if (fixP->fx_r_type == BFD_RELOC_8)
+    {
+      md_number_to_chars (buf, val, 1);
+    }
+  else if (fixP->fx_r_type == BFD_RELOC_16
+	   || fixP->fx_r_type == BFD_RELOC_SPARC_UA16)
     {
       md_number_to_chars (buf, val, 2);
     }

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

only message in thread, other threads:[~2011-11-17  4:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17  4:26 [PATCH] Handle 8-bit data relocations on sparc David Miller

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