Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/gnu/dist/bfd Fix the bss outside of PT_LOAD problem. (for n...
details: https://anonhg.NetBSD.org/src/rev/f2406989e083
branches: trunk
changeset: 475030:f2406989e083
user: matt <matt%NetBSD.org@localhost>
date: Fri Jul 30 00:39:11 1999 +0000
description:
Fix the bss outside of PT_LOAD problem. (for non-paged executables,
the wrong variable (voff) was being substracted instead of the end
of the previous section. therefore the alignment calculations were
all wrong for .bss (which for sparc is aligned 2**8)).
diffstat:
gnu/dist/bfd/elf.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 80f7f725ec8c -r f2406989e083 gnu/dist/bfd/elf.c
--- a/gnu/dist/bfd/elf.c Thu Jul 29 20:58:19 1999 +0000
+++ b/gnu/dist/bfd/elf.c Fri Jul 30 00:39:11 1999 +0000
@@ -2611,7 +2611,9 @@
if ((abfd->flags & D_PAGED) != 0)
adjust = (sec->vma - voff) % bed->maxpagesize;
else
- adjust = (sec->vma - voff) % align;
+ {
+ adjust = (sec->vma - (p->p_paddr + p->p_memsz)) % align;
+ }
}
else
adjust = 0;
@@ -2620,11 +2622,13 @@
{
if (i == 0)
abort ();
+ voff += adjust;
p->p_memsz += adjust;
- off += adjust;
- voff += adjust;
if ((flags & SEC_LOAD) != 0)
- p->p_filesz += adjust;
+ {
+ off += adjust;
+ p->p_filesz += adjust;
+ }
}
sec->filepos = off;
Home |
Main Index |
Thread Index |
Old Index