toolchain updates

This commit is contained in:
John Voltz 2008-03-06 18:52:01 +00:00
parent 3ab16b1fd6
commit 1d161fb437
13 changed files with 229236 additions and 10 deletions

View File

@ -1,8 +1,7 @@
menu "Toolchain"
choice
prompt "Toolchain type"
default BR2_TOOLCHAIN_BUILDROOT if !BR2_avr32
default BR2_TOOLCHAIN_EXTERNAL_SOURCE if BR2_avr32
default BR2_TOOLCHAIN_BUILDROOT
help
Select whether to use the toolchain provided by buildroot
or an external toolchain.
@ -12,8 +11,7 @@ choice
config BR2_TOOLCHAIN_BUILDROOT
bool "Buildroot toolchain"
depends on !BR2_avr32
config BR2_TOOLCHAIN_EXTERNAL
bool "External binary toolchain"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
Index: a/gas/config/tc-avr32.c
===================================================================
--- a/gas/config/tc-avr32.c (revision 31496)
+++ b/gas/config/tc-avr32.c (revision 32014)
@@ -3092,6 +3092,8 @@
/* Make sure the constant pool is properly aligned */
frag_align_code(2, 0);
+ if (bfd_get_section_alignment(stdoutput, pool->section) < 2)
+ bfd_set_section_alignment(stdoutput, pool->section, 2);
/* Assume none of the entries are discarded, and that we need the
maximum amount of alignment. But we're not going to allocate
Index: a/bfd/configure.in
===================================================================
--- a/bfd/configure.in (revision 31496)
+++ b/bfd/configure.in (revision 32014)
@@ -8,7 +8,7 @@
AC_CANONICAL_TARGET
AC_ISC_POSIX
-AM_INIT_AUTOMAKE(bfd, 2.17.atmel.1.2.0)
+AM_INIT_AUTOMAKE(bfd, 2.17.atmel.1.2.1)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.

View File

@ -0,0 +1,78 @@
--- a/bfd/elf32-avr32.c 2008-02-29 08:20:57.000000000 -0500
+++ b/bfd/elf32-avr32.c 2008-02-29 08:26:01.000000000 -0500
@@ -247,7 +247,7 @@ avr32_elf_link_hash_table_create(bfd *ab
GOT. If we ever get more than this many references to the same
symbol, we may need to do something special.
*/
-#define MAX_NR_GOT_HOLES 8192
+#define MAX_NR_GOT_HOLES 2048
/*
AVR32 GOT entry. We need to keep track of refcounts and offsets
@@ -916,16 +916,21 @@ avr32_elf_size_dynamic_sections (bfd *ou
static void
insert_got_entry(struct elf_avr32_link_hash_table *htab, struct got_entry *got)
{
- /* TODO: Support got_refcount > htab->nr_got_holes by using a
- different sort algorithm for those. */
- BFD_ASSERT(got->refcount <= htab->nr_got_holes);
+ /* Any entries with got_refcount > htab->nr_got_holes end up in the
+ * last pigeonhole without any sorting. We expect the number of such
+ * entries to be small, so it is very unlikely to affect
+ * performance. */
+ int entry = got->refcount;
- got->pprev = &htab->got_hole[got->refcount];
- got->next = htab->got_hole[got->refcount];
+ if (entry > htab->nr_got_holes)
+ entry = htab->nr_got_holes;
+
+ got->pprev = &htab->got_hole[entry];
+ got->next = htab->got_hole[entry];
if (got->next)
got->next->pprev = &got->next;
- htab->got_hole[got->refcount] = got;
+ htab->got_hole[entry] = got;
}
/* Decrement the refcount of a GOT entry and update its position in
@@ -933,7 +938,6 @@ insert_got_entry(struct elf_avr32_link_h
static void
unref_got_entry(struct elf_avr32_link_hash_table *htab, struct got_entry *got)
{
- BFD_ASSERT(got->refcount <= htab->nr_got_holes);
BFD_ASSERT(got->refcount > 0);
if (got->next)
@@ -955,7 +959,6 @@ ref_got_entry(struct elf_avr32_link_hash
insert_got_entry(htab, got);
BFD_ASSERT(got->refcount > 0);
- BFD_ASSERT(got->refcount <= htab->nr_got_holes);
}
/* Assign offsets to all GOT entries we intend to keep. The entries
@@ -1106,13 +1109,17 @@ avr32_elf_size_dynamic_sections (bfd *ou
{
/* Allocate holes for the pigeonhole sort algorithm */
pr_debug("Highest GOT refcount: %d\n", htab->nr_got_holes);
+
+ /* Limit the memory usage by clipping the number of pigeonholes
+ * at a predefined maximum. All entries with a higher refcount
+ * will end up in the last pigeonhole. */
+
if (htab->nr_got_holes >= MAX_NR_GOT_HOLES)
{
- /* TODO: Do something clever (different sorting algorithm) */
- _bfd_error_handler(_("Highest refcount %d too high (max %d)\n"),
- htab->nr_got_holes, MAX_NR_GOT_HOLES);
- bfd_set_error(bfd_error_no_memory);
- return FALSE;
+ htab->nr_got_holes = MAX_NR_GOT_HOLES - 1;
+
+ pr_debug("Limiting maximum number of GOT pigeonholes to %u\n",
+ htab->nr_got_holes);
}
htab->got_hole = bfd_zalloc(output_bfd,
sizeof(struct got_entry *)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
Index: gcc/gcc/config/avr32/avr32.opt
===================================================================
--- gcc/gcc/config/avr32/avr32.opt (revision 31583)
+++ gcc/gcc/config/avr32/avr32.opt (working copy)
@@ -71,3 +71,6 @@
Target Report Var(avr32_imm_in_const_pool) Init(-1)
Put large immediates in constant pool. This is enabled by default for archs with insn-cache.
+mno-pic
+Target Report RejectNegative Mask(NO_PIC)
+Do not generate position-independent code.
Index: gcc/gcc/config/avr32/avr32.c
===================================================================
--- gcc/gcc/config/avr32/avr32.c (revision 31583)
+++ gcc/gcc/config/avr32/avr32.c (working copy)
@@ -230,6 +230,9 @@
avr32_imm_in_const_pool = 0;
}
+ if (TARGET_NO_PIC)
+ flag_pic = 0;
+
avr32_add_gc_roots ();
}

View File

@ -0,0 +1,16 @@
Index: gcc/gcc/config/avr32/linux-elf.h
===================================================================
--- gcc/gcc/config/avr32/linux-elf.h (revision 31583)
+++ gcc/gcc/config/avr32/linux-elf.h (working copy)
@@ -122,11 +122,6 @@
builtin_define ("__AVR32_HAS_BRANCH_PRED__"); \
if (TARGET_FAST_FLOAT) \
builtin_define ("__AVR32_FAST_FLOAT__"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)

View File

@ -0,0 +1,12 @@
--- gcc-4.2.1.orig/gcc/config/avr32/avr32.c 2007-10-05 07:52:51.000000000 +0200
+++ gcc-4.2.1/gcc/config/avr32/avr32.c 2007-10-05 07:54:49.000000000 +0200
@@ -1388,7 +1388,8 @@ avr32_expand_builtin (tree exp,
op1 = copy_to_mode_reg (mode1, op1);
}
- op0 = gen_rtx_MEM (SImode, op0);
+ op0 = force_reg (GET_MODE (op0), op0);
+ op0 = gen_rtx_MEM (GET_MODE (op0), op0);
if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
{
error

View File

@ -0,0 +1,48 @@
Index: a/gcc/config/avr32/avr32.c
===================================================================
--- a/gcc/config/avr32/avr32.c (revision 31997)
+++ b/gcc/config/avr32/avr32.c (working copy)
@@ -6323,25 +6323,26 @@
/* If used any other place than as a pointer or as the
destination register we failed */
if (!(single_set (scan)
- && GET_CODE (PATTERN (scan)) == SET
- && ((MEM_P (SET_DEST (PATTERN (scan)))
- && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
- && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) ==
- REGNO (reg)) || (MEM_P (SET_SRC (PATTERN (scan)))
- &&
- REG_P (XEXP
- (SET_SRC (PATTERN (scan)),
- 0))
- &&
- REGNO (XEXP
- (SET_SRC (PATTERN (scan)),
- 0)) == REGNO (reg))))
- && !(GET_CODE (PATTERN (scan)) == SET
- && REG_P (SET_DEST (PATTERN (scan)))
- && !regno_use_in (REGNO (reg),
- SET_SRC (PATTERN (scan)))))
+ && GET_CODE (PATTERN (scan)) == SET
+ && ((MEM_P (SET_DEST (PATTERN (scan)))
+ && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
+ && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) == REGNO (reg))
+ || (MEM_P (SET_SRC (PATTERN (scan)))
+ && REG_P (XEXP (SET_SRC (PATTERN (scan)), 0))
+ && REGNO (XEXP
+ (SET_SRC (PATTERN (scan)), 0)) == REGNO (reg))))
+ && !(GET_CODE (PATTERN (scan)) == SET
+ && REG_P (SET_DEST (PATTERN (scan)))
+ && !regno_use_in (REGNO (reg),
+ SET_SRC (PATTERN (scan)))))
break;
+ /* We cannot replace the pointer in TImode insns
+ as these has a differene addressing mode than the other
+ memory insns. */
+ if ( GET_MODE (SET_DEST (PATTERN (scan))) == TImode )
+ break;
+
/* Check if register is dead or set in this insn */
if (dead_or_set_p (scan, reg))
{

View File

@ -0,0 +1,85 @@
Index: a/gcc/config/avr32/avr32.c
===================================================================
--- a/gcc/config/avr32/avr32.c (revision 32101)
+++ b/gcc/config/avr32/avr32.c (working copy)
@@ -695,8 +695,7 @@
if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
- || vcall_offset
- || flag_pic)
+ || vcall_offset)
{
fputs ("\tpushm\tlr\n", file);
}
@@ -728,47 +727,23 @@
}
- if ( (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
- || vcall_offset)
- && !flag_pic )
+ if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
+ || vcall_offset)
{
fputs ("\tpopm\tlr\n", file);
}
-
- if (flag_pic)
- {
- /* Load the got into lr and then load the pointer
- to the function from the got and put it on the stack.
- We can then call the function and restore lr by issuing
- a doubleword load from the stack. We do not use a popm/ldm
- since it will be treated as a return and might need a flushing
- of the return-stack if available. */
- rtx label = gen_label_rtx ();
- /* Load the got. */
- fputs ("\tlddpc\tlr, 0f\n", file);
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (label));
- fputs ("\trsub\tlr, pc\n", file);
- /* Load the function pointer. */
- fputs ("\tld.w\tlr, lr[", file);
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
- fputs ("@got]\n", file);
- /* Push the function pointer on the stack.*/
- fputs ("\tpushm\tlr\n", file);
- /* Restore the old lr value and load the function pointer into
- pc. */
- fputs ("\tld.d\tlr,sp++\n", file);
- fprintf (file, "\t.align 2\n");
- fprintf (file, "0:\t.long\t.L%d - _GLOBAL_OFFSET_TABLE_\n", CODE_LABEL_NUMBER (label));
- }
- else
- {
- fprintf (file, "\tlddpc\tpc, 0f\n");
- fprintf (file, "\t.align 2\n");
- fputs ("0:\t.long\t", file);
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
- fputc ('\n', file);
- }
+
+ /* Jump to the function. We assume that we can use an rjmp since the
+ function to jump to is local and probably not too far away from
+ the thunk. If this assumption proves to be wrong we could implement
+ this jump by calculating the offset between the jump source and destination
+ and put this in the constant pool and then perform an add to pc.
+ This would also be legitimate PIC code. But for now we hope that an rjmp
+ will be sufficient...
+ */
+ fputs ("\trjmp\t", file);
+ assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
+ fputc ('\n', file);
}
/* Implements target hook vector_mode_supported. */
@@ -1742,7 +1717,7 @@
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("`%s' attribute only applies to functions",
- IDENTIFIER_POINTER (name));
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
/* FIXME: the argument if any is checked for type attributes; should it

View File

@ -0,0 +1,14 @@
diff -Nrup gcc-4.2.1/gcc/config/avr32/avr32.c gcc-4.2.1-new/gcc/config/avr32/avr32.c
--- gcc-4.2.1/gcc/config/avr32/avr32.c 2007-11-15 18:20:25.000000000 +0100
+++ gcc-4.2.1-new/gcc/config/avr32/avr32.c 2007-11-16 13:34:39.000000000 +0100
@@ -705,8 +705,8 @@ avr32_output_mi_thunk (FILE * file,
{
if (avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21"))
{
- fprintf (file, "\tsub\t%s, -0x%x\n", reg_names[this_regno],
- mi_delta);
+ fprintf (file, "\tsub\t%s, %d\n", reg_names[this_regno],
+ -mi_delta);
}
else
{

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,7 @@ comment "Kernel Header Options"
choice
prompt "Kernel Headers"
default BR2_KERNEL_HEADERS_2_6_22_10 if BR2_avr32
default BR2_KERNEL_HEADERS_2_6_22
default BR2_KERNEL_HEADERS_2_6_24
help
Select the version of kernel header files you wish to use.
@ -70,20 +69,16 @@ choice
bool "Linux 2.6.22.10 kernel headers"
config BR2_KERNEL_HEADERS_2_6_22
depends !BR2_avr32 && !BR2_nios2
bool "Linux 2.6.22.x kernel headers"
config BR2_KERNEL_HEADERS_2_6_23
depends !BR2_avr32
bool "Linux 2.6.23.x kernel headers"
config BR2_KERNEL_HEADERS_2_6_24
depends on !BR2_avr32
bool "Linux 2.6.24.x kernel headers"
config BR2_KERNEL_HEADERS_SNAP
bool "Linux 2.6 snapshot"
depends !BR2_avr32
endchoice