This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[m32c] fix nop padding
- From: DJ Delorie <dj at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 13 Dec 2005 21:27:23 -0500
- Subject: [m32c] fix nop padding
Padding .ctor sections is a bad idea :-P
2005-12-13 DJ Delorie <dj@redhat.com>
* config/tc-m32c.c (m32c_md_end): Only pad code sections.
Index: config/tc-m32c.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m32c.c,v
retrieving revision 1.7
diff -p -U3 -r1.7 config/tc-m32c.c
--- config/tc-m32c.c 28 Oct 2005 19:37:14 -0000 1.7
+++ config/tc-m32c.c 14 Dec 2005 02:23:42 -0000
@@ -31,6 +31,7 @@
#include "libbfd.h"
#include "libiberty.h"
#include "safe-ctype.h"
+#include "bfd.h"
/* Structure to hold all of the different components
describing an individual instruction. */
@@ -180,10 +181,13 @@ m32c_md_end (void)
{
int i, n_nops;
- /* Pad with nops for objdump. */
- n_nops = (32 - ((insn_size) % 32)) / 8;
- for (i = 1; i <= n_nops; i++)
- md_assemble ("nop");
+ if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
+ {
+ /* Pad with nops for objdump. */
+ n_nops = (32 - ((insn_size) % 32)) / 8;
+ for (i = 1; i <= n_nops; i++)
+ md_assemble ("nop");
+ }
}
void