aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-02-27 06:52:20 +0000
committerAlan Modra <amodra@gmail.com>2012-02-27 06:52:20 +0000
commitb9fcee797cc69e256f174c6665e88125e4ecc06b (patch)
tree05fc184ca0a4725935d4a696f0adf5a44c266d6b
parent3d301fdc610585d4dd037d9f4816f732aa4417d7 (diff)
downloadgdb-b9fcee797cc69e256f174c6665e88125e4ecc06b.zip
gdb-b9fcee797cc69e256f174c6665e88125e4ecc06b.tar.gz
gdb-b9fcee797cc69e256f174c6665e88125e4ecc06b.tar.bz2
* config/tc-tic4x.c (tic4x_do_align): Remove ATTRIBUTE_UNUSED on
params. Properly generate NOP pattern. Comment reason for subseg_text_p failure.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-tic4x.c30
2 files changed, 23 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 42d4ff1..47dede4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2012-02-27 Alan Modra <amodra@gmail.com>
+ * config/tc-tic4x.c (tic4x_do_align): Remove ATTRIBUTE_UNUSED on
+ params. Properly generate NOP pattern. Comment reason for
+ subseg_text_p failure.
+
+2012-02-27 Alan Modra <amodra@gmail.com>
+
* config/tc-h8300.c (constant_fits_width_p): Trim constant to 32 bits
and sign extend before range tests.
(constant_fits_size_p): Similarly.
diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
index 60f7fb4..fd6cec7 100644
--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -1,6 +1,6 @@
/* tc-tic4x.c -- Assemble for the Texas Instruments TMS320C[34]x.
- Copyright (C) 1997,1998, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation. Inc.
+ Copyright (C) 1997,1998, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2012 Free Software Foundation. Inc.
Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz)
@@ -2955,13 +2955,11 @@ md_pcrel_from (fixS *fixP)
/* Fill the alignment area with NOP's on .text, unless fill-data
was specified. */
int
-tic4x_do_align (int alignment ATTRIBUTE_UNUSED,
- const char *fill ATTRIBUTE_UNUSED,
- int len ATTRIBUTE_UNUSED,
- int max ATTRIBUTE_UNUSED)
+tic4x_do_align (int alignment,
+ const char *fill,
+ int len,
+ int max)
{
- unsigned long nop = TIC_NOP_OPCODE;
-
/* Because we are talking lwords, not bytes, adjust alignment to do words */
alignment += 2;
@@ -2969,11 +2967,17 @@ tic4x_do_align (int alignment ATTRIBUTE_UNUSED,
{
if (fill == NULL)
{
- /*if (subseg_text_p (now_seg))*/ /* FIXME: doesn't work for .text for some reason */
- frag_align_pattern( alignment, (const char *)&nop, sizeof(nop), max);
- return 1;
- /*else
- frag_align (alignment, 0, max);*/
+ /* FIXME: subseg_text_p tests SEC_CODE which isn't in allowed
+ section flags. See bfd/coff-tic4x.c target vecs. */
+ if (1 || subseg_text_p (now_seg))
+ {
+ char nop[4];
+
+ md_number_to_chars (nop, TIC_NOP_OPCODE, 4);
+ frag_align_pattern (alignment, nop, sizeof (nop), max);
+ }
+ else
+ frag_align (alignment, 0, max);
}
else if (len <= 1)
frag_align (alignment, *fill, max);