aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-05-13 21:02:56 +0000
committerSteve Chamberlain <steve@cygnus>1991-05-13 21:02:56 +0000
commit1a602d6e6119641d4b2d3640ccfbac9913dbaad5 (patch)
tree5d8796ee40b75950da35028c37b1ac5af08903c9 /bfd
parentc42538adaf569b07eb4649623353d612561d6e39 (diff)
downloadfsf-binutils-gdb-1a602d6e6119641d4b2d3640ccfbac9913dbaad5.zip
fsf-binutils-gdb-1a602d6e6119641d4b2d3640ccfbac9913dbaad5.tar.gz
fsf-binutils-gdb-1a602d6e6119641d4b2d3640ccfbac9913dbaad5.tar.bz2
* sunos.c: (choose_reloc_size) added: (sunos4_callback) calls
choose_reloc_size. (sunos4_write_object_contents) now calls choose_reloc_size so outputs relocs correctly, also calculates the size of the sections correctly. * aout.c: (look in the rrgs I hate VI) ~ ~ ~ ~ 
Diffstat (limited to 'bfd')
-rwxr-xr-xbfd/aout.c25
-rw-r--r--bfd/sunos.c7
2 files changed, 18 insertions, 14 deletions
diff --git a/bfd/aout.c b/bfd/aout.c
index 00290ae..3550179 100755
--- a/bfd/aout.c
+++ b/bfd/aout.c
@@ -201,6 +201,11 @@ some_aout_object_p (abfd, callback_to_real_object_p)
obj_bsssec (abfd)->size = execp->a_bss;
obj_textsec (abfd)->size = execp->a_text;
+ if (abfd->flags & D_PAGED) {
+ obj_textsec (abfd)->size -= EXEC_BYTES_SIZE;
+ }
+
+
obj_textsec (abfd)->flags = (execp->a_trsize != 0 ?
(SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_HAS_CONTENTS) :
(SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS));
@@ -413,21 +418,23 @@ aout_set_section_contents (abfd, section, location, offset, count)
obj_textsec(abfd)->filepos = sizeof(struct exec);
obj_textsec(abfd)->size = align_power(obj_textsec(abfd)->size,
obj_textsec(abfd)->alignment_power);
- obj_datasec(abfd)->filepos = obj_textsec (abfd)->size;
+ obj_datasec(abfd)->filepos = obj_textsec (abfd)->size + EXEC_BYTES_SIZE;
obj_datasec(abfd)->size = align_power(obj_datasec(abfd)->size,
obj_datasec(abfd)->alignment_power);
+
}
/* regardless, once we know what we're doing, we might as well get going */
- if (section != obj_bsssec(abfd)) {
- bfd_seek (abfd, section->filepos + offset, SEEK_SET);
+ if (section != obj_bsssec(abfd))
+ {
+ bfd_seek (abfd, section->filepos + offset, SEEK_SET);
- if (count) {
- return (bfd_write ((PTR)location, 1, count, abfd) == count) ?
- true : false;
- }
- return false;
- }
+ if (count) {
+ return (bfd_write ((PTR)location, 1, count, abfd) == count) ?
+ true : false;
+ }
+ return false;
+ }
return true;
}
diff --git a/bfd/sunos.c b/bfd/sunos.c
index d9235da..a451a48 100644
--- a/bfd/sunos.c
+++ b/bfd/sunos.c
@@ -271,11 +271,8 @@ sunos4_write_object_contents (abfd)
/* This is not strictly true, but will probably do for the default
case. FIXME.
*/
- /* Also the size has already had the sizeof the header taken into
- account. It may be wrong for the application to have to do this
- (though this is what sizeof_headers is for), but it's the way
- it is, so that's the way it will stay for the moment.*/
- execp->a_text = obj_textsec (abfd)->size ; /*+ sizeof(struct exec);*/
+
+ execp->a_text = obj_textsec (abfd)->size + EXEC_BYTES_SIZE;
N_SET_MAGIC (*execp, ZMAGIC);
} else if (abfd->flags & WP_TEXT) {
N_SET_MAGIC (*execp, NMAGIC);