summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd/elfcode.h
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
commitc3c8d76890b592bf5acc1a9b7faeabd9b829dd71 (patch)
tree6358a23d0df9de73b6d5d6d3a75545ff35f05b47 /gnu/usr.bin/binutils/bfd/elfcode.h
parent4ba440a6e788da3a64fa29b782c37150a3f5cc18 (diff)
Merge the Cygnus 960904 sources
Diffstat (limited to 'gnu/usr.bin/binutils/bfd/elfcode.h')
-rw-r--r--gnu/usr.bin/binutils/bfd/elfcode.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/bfd/elfcode.h b/gnu/usr.bin/binutils/bfd/elfcode.h
index 97fb79c2015..62a8170894f 100644
--- a/gnu/usr.bin/binutils/bfd/elfcode.h
+++ b/gnu/usr.bin/binutils/bfd/elfcode.h
@@ -588,6 +588,15 @@ elf_object_p (abfd)
goto got_no_match;
elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
elf_elfsections (abfd)[shindex] = i_shdrp + shindex;
+
+ /* If the section is loaded, but not page aligned, clear
+ D_PAGED. */
+ if ((i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
+ && i_shdrp[shindex].sh_type != SHT_NOBITS
+ && (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
+ % ebd->maxpagesize)
+ != 0))
+ abfd->flags &= ~D_PAGED;
}
if (i_ehdrp->e_shstrndx)
{
@@ -738,6 +747,8 @@ write_relocs (abfd, sec, data)
sym = *ptr->sym_ptr_ptr;
if (sym == last_sym)
n = last_sym_idx;
+ else if (bfd_is_abs_section (sym->section) && sym->value == 0)
+ n = STN_UNDEF;
else
{
last_sym = sym;
@@ -750,7 +761,8 @@ write_relocs (abfd, sec, data)
last_sym_idx = n;
}
- if ((*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
+ if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
+ && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
&& ! _bfd_elf_validate_reloc (abfd, ptr))
{
*failedp = true;