aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-xtensa.c59
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/elf/elf.exp3
-rw-r--r--gas/testsuite/gas/elf/section2.e-xtensa9
5 files changed, 82 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8e45803..ce26d2e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2006-11-27 Bob Wilson <bob.wilson@acm.org>
+
+ * config/tc-xtensa.c (XSHAL_ABI): Add default definition.
+ (directive_state): Disable scheduling by default.
+ (xtensa_add_config_info): New.
+ (xtensa_end): Call xtensa_add_config_info.
+
2006-11-27 Eric Botcazou <ebotcazou@adacore.com>
* config/tc-sparc.c (tc_gen_reloc): Turn aligned relocs into
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 5f0d8a8..dbffac4 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -30,6 +30,11 @@
#include "struc-symbol.h"
#include "xtensa-config.h"
+/* Provide default values for new configuration settings. */
+#ifndef XSHAL_ABI
+#define XSHAL_ABI 0
+#endif
+
#ifndef uint32
#define uint32 unsigned int
#endif
@@ -396,7 +401,7 @@ bfd_boolean directive_state[] =
FALSE, /* freeregs */
FALSE, /* longcalls */
FALSE, /* literal_prefix */
- TRUE, /* schedule */
+ FALSE, /* schedule */
#if XSHAL_USE_ABSOLUTE_LITERALS
TRUE /* absolute_literals */
#else
@@ -6859,6 +6864,7 @@ static void xtensa_fix_b_j_loop_end_frags (void);
static void xtensa_fix_close_loop_end_frags (void);
static void xtensa_fix_short_loop_frags (void);
static void xtensa_sanity_check (void);
+static void xtensa_add_config_info (void);
void
xtensa_end (void)
@@ -6889,6 +6895,8 @@ xtensa_end (void)
xtensa_mark_zcl_first_insns ();
xtensa_sanity_check ();
+
+ xtensa_add_config_info ();
}
@@ -7797,6 +7805,55 @@ is_local_forward_loop (const TInsn *insn, fragS *fragP)
return FALSE;
}
+
+#define XTINFO_NAME "Xtensa_Info"
+#define XTINFO_NAMESZ 12
+#define XTINFO_TYPE 1
+
+static void
+xtensa_add_config_info (void)
+{
+ asection *info_sec;
+ char *data, *p;
+ int sz;
+
+ info_sec = subseg_new (".xtensa.info", 0);
+ bfd_set_section_flags (stdoutput, info_sec, SEC_HAS_CONTENTS | SEC_READONLY);
+
+ data = xmalloc (100);
+ sprintf (data, "USE_ABSOLUTE_LITERALS=%d\nABI=%d\n",
+ XSHAL_USE_ABSOLUTE_LITERALS, XSHAL_ABI);
+ sz = strlen (data) + 1;
+
+ /* Add enough null terminators to pad to a word boundary. */
+ do
+ data[sz++] = 0;
+ while ((sz & 3) != 0);
+
+ /* Follow the standard note section layout:
+ First write the length of the name string. */
+ p = frag_more (4);
+ md_number_to_chars (p, (valueT) XTINFO_NAMESZ, 4);
+
+ /* Next comes the length of the "descriptor", i.e., the actual data. */
+ p = frag_more (4);
+ md_number_to_chars (p, (valueT) sz, 4);
+
+ /* Write the note type. */
+ p = frag_more (4);
+ md_number_to_chars (p, (valueT) XTINFO_TYPE, 4);
+
+ /* Write the name field. */
+ p = frag_more (XTINFO_NAMESZ);
+ memcpy (p, XTINFO_NAME, XTINFO_NAMESZ);
+
+ /* Finally, write the descriptor. */
+ p = frag_more (sz);
+ memcpy (p, data, sz);
+
+ free (data);
+}
+
/* Alignment Functions. */
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index ca48446..e3c14fc 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-27 Bob Wilson <bob.wilson@acm.org>
+
+ * gas/elf/section2.e-xtensa: New file.
+ * gas/elf/elf.exp: Use it.
+
2006-11-22 Daniel Jacobowitz <dan@codesourcery.com>
* gas/arm/arm7t.d, gas/arm/neon-ldst-rm.d, gas/arm/thumb2_pool.d,
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 0d51aa0..55cfa79 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -53,6 +53,9 @@ if { ([istarget "*-*-*elf*"]
if {[istarget "score-*-*"]} then {
set target_machine -score
}
+ if {[istarget "xtensa-*-*"]} then {
+ set target_machine -xtensa
+ }
if { ([istarget "*arm*-*-*"]
|| [istarget "xscale*-*-*"]) } {
diff --git a/gas/testsuite/gas/elf/section2.e-xtensa b/gas/testsuite/gas/elf/section2.e-xtensa
new file mode 100644
index 0000000..84463b1
--- /dev/null
+++ b/gas/testsuite/gas/elf/section2.e-xtensa
@@ -0,0 +1,9 @@
+
+Symbol table '.symtab' contains 6 entries:
+ Num: Value[ ]* Size Type Bind Vis Ndx Name
+ 0: 0+0 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0+0 0 SECTION LOCAL DEFAULT 1
+ 2: 0+0 0 SECTION LOCAL DEFAULT 2
+ 3: 0+0 0 SECTION LOCAL DEFAULT 3
+ 4: 0+0 0 SECTION LOCAL DEFAULT 4
+ 5: 0+0 0 SECTION LOCAL DEFAULT 5