aboutsummaryrefslogtreecommitdiff
path: root/gas/config
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
parent0acc96e1c83a4b24ce0af95bbd36fcce6a56644c (diff)
downloadfsf-binutils-gdb-e15f6d30741e0ec270b48deafdbd2c781f01fae6.zip
fsf-binutils-gdb-e15f6d30741e0ec270b48deafdbd2c781f01fae6.tar.gz
fsf-binutils-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')
-rw-r--r--gas/config/tc-i860.c33
-rw-r--r--gas/config/tc-i860.h6
2 files changed, 39 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;
+}
+
diff --git a/gas/config/tc-i860.h b/gas/config/tc-i860.h
index 72a5b6a..c5c39b4 100644
--- a/gas/config/tc-i860.h
+++ b/gas/config/tc-i860.h
@@ -86,4 +86,10 @@ extern int target_big_endian;
visible symbols can be overridden. */
#define EXTERN_FORCE_RELOC 0
+/* Bits for filling in rs_align_code fragments with NOPs. */
+extern void i860_handle_align (struct frag *);
+#define HANDLE_ALIGN(fragp) i860_handle_align (fragp)
+
+#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 4)
+
#endif /* TC_I860 */