update AVR32 binutils patches

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10006 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Imre Kaloz 2007-12-28 18:26:50 +00:00
parent ffc2b70896
commit 43fd42318b
5 changed files with 28176 additions and 17871 deletions

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

@ -1,103 +0,0 @@
Index: binutils-2.17/bfd/elf32-avr32.c
===================================================================
--- binutils-2.17.orig/bfd/elf32-avr32.c 2007-06-28 09:19:36.580675344 +0200
+++ binutils-2.17/bfd/elf32-avr32.c 2007-06-28 09:19:38.494384416 +0200
@@ -298,7 +298,7 @@
/* Shortcuts to get to dynamic linker sections. */
asection *sgot;
asection *srelgot;
- asection *sreldyn;
+ /* asection *sreldyn; */
asection *sstub;
/* We use a variation of Pigeonhole Sort to sort the GOT. After the
@@ -506,14 +506,14 @@
if (!avr32_elf_create_got_section (dynobj, info))
return FALSE;
- if (!htab->sreldyn)
+ /* if (!htab->sreldyn)
htab->sreldyn = create_dynamic_section(dynobj, ".rela.dyn",
- flags | SEC_READONLY, 2);
+ flags | SEC_READONLY, 2); */
if (!htab->sstub)
htab->sstub = create_dynamic_section(dynobj, ".stub",
flags | SEC_READONLY | SEC_CODE, 2);
- if (!htab->sreldyn || !htab->sstub)
+ if (/* !htab->sreldyn || */ !htab->sstub)
return FALSE;
return TRUE;
@@ -669,12 +669,12 @@
if ((info->shared || h != NULL)
&& (sec->flags & SEC_ALLOC))
{
- if (htab->sreldyn == NULL)
+ if (htab->srelgot == NULL)
{
- htab->sreldyn = create_dynamic_section(dynobj, ".rela.dyn",
+ htab->srelgot = create_dynamic_section(dynobj, ".rela.got",
bed->dynamic_sec_flags
| SEC_READONLY, 2);
- if (htab->sreldyn == NULL)
+ if (htab->srelgot == NULL)
return FALSE;
}
@@ -1062,7 +1062,7 @@
{
pr_debug("Allocating %d dynamic reloc against symbol %s...\n",
havr->possibly_dynamic_relocs, h->root.root.string);
- htab->sreldyn->size += (havr->possibly_dynamic_relocs
+ htab->srelgot->size += (havr->possibly_dynamic_relocs
* sizeof(Elf32_External_Rela));
}
@@ -1156,7 +1156,7 @@
/* Allocate space for local sym dynamic relocs */
BFD_ASSERT(htab->local_dynamic_relocs == 0 || info->shared);
if (htab->local_dynamic_relocs)
- htab->sreldyn->size += (htab->local_dynamic_relocs
+ htab->srelgot->size += (htab->local_dynamic_relocs
* sizeof(Elf32_External_Rela));
/* We now have determined the sizes of the various dynamic
@@ -3191,7 +3191,6 @@
struct got_entry **local_got_ents;
asection *sgot;
asection *srelgot;
- asection *sreldyn;
pr_debug("(6) relocate section %s:<%s> (size 0x%lx)\n",
input_bfd->filename, input_section->name, input_section->size);
@@ -3207,7 +3206,6 @@
local_got_ents = elf_local_got_ents(input_bfd);
sgot = htab->sgot;
srelgot = htab->srelgot;
- sreldyn = htab->sreldyn;
relend = relocs + input_section->reloc_count;
for (rel = relocs; rel < relend; rel++)
@@ -3444,15 +3442,15 @@
}
}
- pr_debug("sreldyn reloc_count: %d, size %lu\n",
- sreldyn->reloc_count, sreldyn->size);
+ pr_debug("srelgot reloc_count: %d, size %lu\n",
+ srelgot->reloc_count, srelgot->size);
- loc = sreldyn->contents;
- loc += sreldyn->reloc_count++ * sizeof(Elf32_External_Rela);
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count++ * sizeof(Elf32_External_Rela);
bfd_elf32_swap_reloca_out(output_bfd, &outrel, loc);
- BFD_ASSERT(sreldyn->reloc_count * sizeof(Elf32_External_Rela)
- <= sreldyn->size);
+ BFD_ASSERT(srelgot->reloc_count * sizeof(Elf32_External_Rela)
+ <= srelgot->size);
if (!relocate)
continue;

View File

@ -1,19 +0,0 @@
Index: binutils-2.17/bfd/elf32-avr32.c
===================================================================
--- binutils-2.17.orig/bfd/elf32-avr32.c 2007-06-28 09:19:38.494384416 +0200
+++ binutils-2.17/bfd/elf32-avr32.c 2007-06-28 09:19:38.682355840 +0200
@@ -2449,9 +2449,13 @@
after the relaxation code is done, so we can't really
trust that our "distance" is correct. There's really no
easy solution to this problem, so we'll just disallow
- direct references to SEC_DATA sections. */
+ direct references to SEC_DATA sections.
+
+ Oh, and .bss isn't actually SEC_DATA, so we disallow
+ !SEC_HAS_CONTENTS as well. */
if (!dynamic && defined
&& !(sym_sec->flags & SEC_DATA)
+ && (sym_sec->flags & SEC_HAS_CONTENTS)
&& next_state->direct)
{
next_state = &relax_state[next_state->direct];

View File

@ -1,13 +0,0 @@
Index: binutils-2.17/bfd/elf32-avr32.c
===================================================================
--- binutils-2.17.orig/bfd/elf32-avr32.c 2007-06-28 09:19:38.682355840 +0200
+++ binutils-2.17/bfd/elf32-avr32.c 2007-06-28 09:19:38.869327416 +0200
@@ -395,6 +395,8 @@
/* Prevent the BFD core from creating bogus got_entry pointers */
ret->root.init_got_refcount.glist = NULL;
ret->root.init_plt_refcount.glist = NULL;
+ ret->root.init_got_offset.glist = NULL;
+ ret->root.init_plt_offset.glist = NULL;
return &ret->root.root;
}