+2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
+ (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
+ even if they are not loaded.
+ * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
+ first.
+
2008-04-25 Jay Foad <jay.foad@gmail.com>
* reloc16.c (bfd_coff_reloc16_get_value): Add support for
ret = sizeof (arelent *);
for (s = abfd->sections; s != NULL; s = s->next)
- if ((s->flags & SEC_LOAD) != 0
- && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
+ if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
&& (elf_section_data (s)->this_hdr.sh_type == SHT_REL
|| elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
ret += ((s->size / elf_section_data (s)->this_hdr.sh_entsize)
ret = 0;
for (s = abfd->sections; s != NULL; s = s->next)
{
- if ((s->flags & SEC_LOAD) != 0
- && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
+ if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
&& (elf_section_data (s)->this_hdr.sh_type == SHT_REL
|| elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
{
{
asection *s;
+ /* Data first, since setting text_index_section changes
+ _bfd_elf_link_omit_section_dynsym. */
for (s = output_bfd->sections; s != NULL; s = s->next)
- if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY))
- == (SEC_ALLOC | SEC_READONLY))
+ if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC)
&& !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s))
{
- elf_hash_table (info)->text_index_section = s;
+ elf_hash_table (info)->data_index_section = s;
break;
}
for (s = output_bfd->sections; s != NULL; s = s->next)
- if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC)
+ if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY))
+ == (SEC_ALLOC | SEC_READONLY))
&& !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s))
{
- elf_hash_table (info)->data_index_section = s;
+ elf_hash_table (info)->text_index_section = s;
break;
}
+2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
+ * ld-arm/symbian-seg1.s, ld-arm/symbian-seg1.d: New files.
+ * ld-arm/arm-elf.exp: Run symbian-seg1.
+
2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/rgn-over8.s: Tweak.
run_dump_test "emit-relocs1-vxworks"
}
+if { [istarget "arm*-*-symbianelf*"] } {
+ run_dump_test "symbian-seg1"
+}
+
# Exclude non-ARM-ELF targets.
if { ![is_elf_format] || ![istarget "arm*-*-*"] } {
--- /dev/null
+#source: symbian-seg1.s
+#ld: -Ttext 0x10000 -Tdata 0x400000
+#objdump: -dR
+#...
+ +10000: 00400000 .word 0x00400000
+ +10000: R_ARM_RELATIVE .data
+ +10004: 00010008 .word 0x00010008
+ +10004: R_ARM_RELATIVE .text
--- /dev/null
+ .text
+ .globl _start
+_start:
+ .word datavar
+ .word rodatavar
+
+ .section ".rodata", "a"
+rodatavar:
+ .word 0
+
+ .section ".data", "aw"
+datavar:
+ .word 0