+2009-11-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elfread.c (elf_symfile_segments): Do not warn about
+ uninitialized sections outside of load segments.
+
2009-11-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* symfile.c (build_id_to_debug_filename): New variable debugdir. Move
break;
}
- if (bfd_get_section_size (sect) > 0 && j == num_segments)
+ /* We should have found a segment for every non-empty section.
+ If we haven't, we will not relocate this section by any
+ offsets we apply to the segments. As an exception, do not
+ warn about SHT_NOBITS sections; in normal ELF execution
+ environments, SHT_NOBITS means zero-initialized and belongs
+ in a segment, but in no-OS environments some tools (e.g. ARM
+ RealView) use SHT_NOBITS for uninitialized data. Since it is
+ uninitialized, it doesn't need a program header. Such
+ binaries are not relocatable. */
+ if (bfd_get_section_size (sect) > 0 && j == num_segments
+ && (bfd_get_section_flags (abfd, sect) & SEC_LOAD) != 0)
warning (_("Loadable segment \"%s\" outside of ELF segments"),
bfd_section_name (abfd, sect));
}