summaryrefslogtreecommitdiff
path: root/gas/config/tc-i860.c
diff options
context:
space:
mode:
authorJason Eckhardt <jle@rice.edu>2003-08-06 23:59:36 +0000
committerJason Eckhardt <jle@rice.edu>2003-08-06 23:59:36 +0000
commite4c808f2d67640c158bef94067fd955f3935611b (patch)
tree544269c7d13728d8318dc3b4a5cc06dde717eb03 /gas/config/tc-i860.c
parent0a53d3ff12690106ade497141f298b55f4da5403 (diff)
downloadbinutils-redhat-e4c808f2d67640c158bef94067fd955f3935611b.tar.gz
gas:
2003-08-06 Jason Eckhardt <jle@rice.edu> * config/tc-i860.c (i860_handle_align): New function. * config/tc-i860.h (HANDLE_ALIGN): Define macro. (MAX_MEM_FOR_RS_ALIGN_CODE): Define macro. gas/testsuite: 2003-08-06 Jason Eckhardt <jle@rice.edu> * gas/i860/dir-align01.{s,d}: New files. * gas/i860/i860.exp: Execute the new test above.
Diffstat (limited to 'gas/config/tc-i860.c')
-rw-r--r--gas/config/tc-i860.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index d170b7047c..b281d523df 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -1462,3 +1462,36 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
}
return reloc;
}
+
+/* This is called from HANDLE_ALIGN in write.c. Fill in the contents
+ of an rs_align_code fragment. */
+
+void
+i860_handle_align (fragS *fragp)
+{
+ /* Instructions are always stored little-endian on the i860. */
+ static const unsigned char le_nop[] = { 0x00, 0x00, 0x00, 0xA0 };
+
+ int bytes;
+ char *p;
+
+ if (fragp->fr_type != rs_align_code)
+ return;
+
+ bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix;
+ p = fragp->fr_literal + fragp->fr_fix;
+
+ /* Make sure we are on a 4-byte boundary, in case someone has been
+ putting data into a text section. */
+ if (bytes & 3)
+ {
+ int fix = bytes & 3;
+ memset (p, 0, fix);
+ p += fix;
+ fragp->fr_fix += fix;
+ }
+
+ memcpy (p, le_nop, 4);
+ fragp->fr_var = 4;
+}
+