aboutsummaryrefslogtreecommitdiff
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
commite15f6d30741e0ec270b48deafdbd2c781f01fae6 (patch)
tree2a0e2aaa9a02bbb3eb8e3e0990a414623df89f98 /gas/config/tc-i860.c
parent0acc96e1c83a4b24ce0af95bbd36fcce6a56644c (diff)
downloadgdb-e15f6d30741e0ec270b48deafdbd2c781f01fae6.zip
gdb-e15f6d30741e0ec270b48deafdbd2c781f01fae6.tar.gz
gdb-e15f6d30741e0ec270b48deafdbd2c781f01fae6.tar.bz2
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 d170b70..b281d52 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;
+}
+