skip a page in the segment, then we need a new segment. */
new_segment = true;
}
- else if ((abfd->flags & D_PAGED) == 0)
- {
- /* If the file is not demand paged, which means that we
- don't require the sections to be correctly aligned in the
- file, then there is no other reason for a new segment. */
- new_segment = false;
- }
else if ((last_hdr->flags & SEC_LOAD) == 0
&& (hdr->flags & SEC_LOAD) != 0)
{
nonloadable section in the same segment. */
new_segment = true;
}
+ else if ((abfd->flags & D_PAGED) == 0)
+ {
+ /* If the file is not demand paged, which means that we
+ don't require the sections to be correctly aligned in the
+ file, then there is no other reason for a new segment. */
+ new_segment = false;
+ }
else if (! writable
&& (hdr->flags & SEC_READONLY) == 0
&& (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize)
if (m->count > 0)
{
BFD_ASSERT (p->p_type == PT_LOAD);
+
+ if (p->p_vaddr < off)
+ {
+ _bfd_error_handler ("%s: Not enough room for program headers, try linking with -N",
+ bfd_get_filename (abfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
p->p_vaddr -= off;
if (! m->p_paddr_valid)
p->p_paddr -= off;
{
bfd_vma adjust;
- /* The section VMA must equal the file position modulo
- the page size. */
- if ((flags & SEC_ALLOC) != 0)
+ if ((flags & SEC_LOAD) != 0)
+ adjust = sec->lma - (p->p_paddr + p->p_memsz);
+ else if ((flags & SEC_ALLOC) != 0)
{
+ /* The section VMA must equal the file position
+ modulo the page size. FIXME: I'm not sure if
+ this adjustment is really necessary. We used to
+ not have the SEC_LOAD case just above, and then
+ this was necessary, but now I'm not sure. */
if ((abfd->flags & D_PAGED) != 0)
adjust = (sec->vma - voff) % bed->maxpagesize;
else
adjust = (sec->vma - voff) % align;
- if (adjust != 0)
- {
- if (i == 0)
- abort ();
- p->p_memsz += adjust;
- off += adjust;
- voff += adjust;
- if ((flags & SEC_LOAD) != 0)
- p->p_filesz += adjust;
- }
+ }
+
+ if (adjust != 0)
+ {
+ if (i == 0)
+ abort ();
+ p->p_memsz += adjust;
+ off += adjust;
+ voff += adjust;
+ if ((flags & SEC_LOAD) != 0)
+ p->p_filesz += adjust;
}
sec->filepos = off;
- if ((flags & SEC_LOAD) != 0)
+ /* We check SEC_HAS_CONTENTS here because if NOLOAD is
+ used in a linker script we may have a section with
+ SEC_LOAD clear but which is supposed to have
+ contents. */
+ if ((flags & SEC_LOAD) != 0
+ || (flags & SEC_HAS_CONTENTS) != 0)
off += sec->_raw_size;
if ((flags & SEC_ALLOC) != 0)
voff += sec->_raw_size;
i_ehdrp->e_machine = EM_CYGNUS_D30V;
break;
/* end-sanitize-d30v */
-/* start-sanitize-v850 */
case bfd_arch_v850:
switch (bfd_get_mach (abfd))
{
default:
case 0: i_ehdrp->e_machine = EM_CYGNUS_V850; break;
-/* start-sanitize-v850e */
- case bfd_mach_v850e: i_ehdrp->e_machine = EM_CYGNUS_V850E; break;
-/* end-sanitize-v850e */
-/* start-sanitize-v850eq */
- case bfd_mach_v850eq: i_ehdrp->e_machine = EM_CYGNUS_V850EQ; break;
-/* end-sanitize-v850eq */
}
break;
-/* end-sanitize-v850 */
case bfd_arch_arc:
i_ehdrp->e_machine = EM_CYGNUS_ARC;
break;
case bfd_arch_mn10300:
i_ehdrp->e_machine = EM_CYGNUS_MN10300;
break;
+/* start-sanitize-sky */
+ case bfd_arch_txvu:
+ i_ehdrp->e_machine = EM_CYGNUS_TXVU;
+ break;
+/* end-sanitize-sky */
/* also note that EM_M32, AT&T WE32100 is unknown to bfd */
default:
i_ehdrp->e_machine = EM_NONE;
bfd_vma low_func;
asymbol **p;
+ if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr))
+ return true;
+
if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
&found, filename_ptr,
functionname_ptr, line_ptr,