ibfd = info->input_bfds;
/* This should really be SEC_LINKER_CREATED, but then we'd need
to write out the section ourselves. */
- flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
+ flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags);
if (s == NULL
- || !bfd_set_section_alignment (s, 4))
+ || !bfd_set_section_alignment (s, 2))
return false;
/* Because we didn't set SEC_LINKER_CREATED we need to set the
proper section type. */
asection *sec)
{
if (strcmp (sec->name, SPU_PTNOTE_SPUNAME) == 0)
- hdr->sh_type = SHT_NOTE;
+ {
+ hdr->sh_type = SHT_NOTE;
+ hdr->sh_addralign = 16;
+ }
return true;
}
+/* .note.spu_name is read by the PPU from the object, and possibly
+ needs the file offset to be aligned to 16 bytes. We used to simply
+ call bfd_set_section_alignment to set the alignment to 16, but if
+ left like that it triggers a readelf warning. Now for layout we
+ tweak the alignment to 16 in spu_elf_fake_sections, and restore it
+ to 4 here. */
+
+static bool
+spu_elf_final_write_processing (bfd *abfd)
+{
+ asection *sec = bfd_get_section_by_name (abfd, SPU_PTNOTE_SPUNAME);
+ if (sec != NULL)
+ {
+ struct bfd_elf_section_data *esd = elf_section_data (sec);
+ esd->this_hdr.sh_addralign = 4;
+ }
+ return _bfd_elf_final_write_processing (abfd);
+}
+
/* Tweak phdrs before writing them out. */
static bool
#define elf_backend_modify_headers spu_elf_modify_headers
#define elf_backend_init_file_header spu_elf_init_file_header
#define elf_backend_fake_sections spu_elf_fake_sections
+#define elf_backend_final_write_processing spu_elf_final_write_processing
#define elf_backend_special_sections spu_elf_special_sections
#define bfd_elf32_bfd_final_link spu_elf_final_link
#source: orphan-region.s
#ld: -T orphan-region.ld -N -z stack-size=0 --no-warn-rwx-segments
#readelf: -S -l --wide
-#xfail: [uses_genelf] hppa*64*-*-hpux* spu-*-*
+#xfail: [uses_genelf] hppa*64*-*-hpux*
# if not using elf.em, you don't get fancy orphan handling
-# spu twiddles LOAD range, hppa64 adds PHDR
+# hppa64 adds PHDR
#...
\[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*
.* ila \$79,1076 # 434
.* bra? .* <__ovly_load>.*
-#00000330 <00000000\.ovl_call\.f1_a1>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 04 04 00.*
-#
-#00000338 <00000000\.ovl_call\.f2_a1>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 04 04 04.*
-#
-#00000340 <00000000\.ovl_call\.f1_a2>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 08 04 00.*
-#
-#00000348 <00000000\.ovl_call\.f2_a2>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 08 04 24.*
-#
-#00000350 <00000000\.ovl_call\.f4_a1>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 04 04 10.*
-#
-#00000358 <00000000.ovl_call.14:8>:
-#.* bra?sl \$75,.* <__ovly_load>.*
-#.*00 08 04 34.*
-
Disassembly of section \.ov_a1:
00000400 <f1_a1>:
00000450 <_ovly_table>:
450: 00 00 04 00 .*
454: 00 00 00 20 .*
-# 458: 00 00 03 40 .*
- 458: 00 00 01 00 .*
+ 458: 00 00 00 e0 .*
45c: 00 00 00 01 .*
460: 00 00 04 00 .*
464: 00 00 00 40 .*
-# 468: 00 00 03 60 .*
- 468: 00 00 01 20 .*
+ 468: 00 00 01 00 .*
46c: 00 00 00 01 .*
00000470 <_ovly_buf_table>: