daily update
[deliverable/binutils-gdb.git] / bfd / elf-nacl.c
index 3ba7f5582e41e13093147b77214c2ba6a4eff2c9..842e367d97d8b687a647d07707f3229d0ee7c9fe 100644 (file)
@@ -62,13 +62,18 @@ segment_nonexecutable_and_has_contents (struct elf_segment_map *seg)
    The first non-executable PT_LOAD segment appears first in the file
    and contains the ELF file header and phdrs.  */
 bfd_boolean
-nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
+nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
 {
   struct elf_segment_map **m = &elf_tdata (abfd)->segment_map;
   struct elf_segment_map **first_load = NULL;
   struct elf_segment_map **last_load = NULL;
   bfd_boolean moved_headers = FALSE;
 
+  if (info != NULL && info->user_phdrs)
+    /* The linker script used PHDRS explicitly, so don't change what the
+       user asked for.  */
+    return TRUE;
+
   while (*m != NULL)
     {
       struct elf_segment_map *seg = *m;
@@ -141,6 +146,11 @@ nacl_modify_program_headers (bfd *abfd,
   Elf_Internal_Phdr *phdr = elf_tdata (abfd)->phdr;
   Elf_Internal_Phdr *p = phdr;
 
+  if (info != NULL && info->user_phdrs)
+    /* The linker script used PHDRS explicitly, so don't change what the
+       user asked for.  */
+    return TRUE;
+
   /* Find the PT_LOAD that contains the headers (should be the first).  */
   while (*m != NULL)
     {
This page took 0.023859 seconds and 4 git commands to generate.