case SHT_DYNAMIC: /* Dynamic linking information. */
case SHT_NOBITS: /* .bss section. */
case SHT_HASH: /* .hash section. */
+ case SHT_NOTE: /* .note section. */
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
case SHT_SYMTAB: /* A symbol table */
}
break;
- case SHT_NOTE:
- break;
-
case SHT_SHLIB:
return true;
return false;
}
+ if (bed->elf_backend_modify_segment_map)
+ {
+ if (! (*bed->elf_backend_modify_segment_map) (abfd))
+ return false;
+ }
+
count = 0;
for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
++count;
if (count == 0)
return true;
- /* Let the backend count up any program headers it might need. */
- if (bed->elf_backend_create_program_headers)
- count = ((*bed->elf_backend_create_program_headers)
- (abfd, (Elf_Internal_Phdr *) NULL, count));
-
/* If we already counted the number of program segments, make sure
that we allocated enough space. This happens when SIZEOF_HEADERS
is used in a linker script. */
}
}
- /* Let the backend set up any program headers it might need. */
- if (bed->elf_backend_create_program_headers)
- count = ((*bed->elf_backend_create_program_headers)
- (abfd, phdrs, count));
-
/* Clear out any program headers we allocated but did not use. */
for (; count < alloc; count++, p++)
{
}
/* Let the backend count up any program headers it might need. */
- if (bed->elf_backend_create_program_headers)
- segs = ((*bed->elf_backend_create_program_headers)
- (abfd, (Elf_Internal_Phdr *) NULL, segs));
+ if (bed->elf_backend_additional_program_headers)
+ {
+ int a;
+
+ a = (*bed->elf_backend_additional_program_headers) (abfd);
+ if (a == -1)
+ abort ();
+ segs += a;
+ }
elf_tdata (abfd)->program_header_size = segs * bed->s->sizeof_phdr;
return elf_tdata (abfd)->program_header_size;