diff options
author | Alan Modra <amodra@gmail.com> | 2005-03-01 00:38:52 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-03-01 00:38:52 +0000 |
commit | 70bfececf5f88eb75203859f69a5382bad663f9b (patch) | |
tree | e9e9a47016378a8d4b1c004d9ab113aaf963110c /bfd | |
parent | 2ac2974bafe7ff678bffabfaf9f80c818d7572a5 (diff) | |
download | gdb-70bfececf5f88eb75203859f69a5382bad663f9b.zip gdb-70bfececf5f88eb75203859f69a5382bad663f9b.tar.gz gdb-70bfececf5f88eb75203859f69a5382bad663f9b.tar.bz2 |
* bout.c (b_out_write_object_contents): Don't use sizeof on host
structs to size on-disk structures.
(b_out_set_section_contents): Size the external struct, not the
internal one for on-disk size.
(b_out_sizeof_headers): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/bout.c | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9be74e3..ee38ffc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,13 @@ 2005-03-01 Alan Modra <amodra@bigpond.net.au> + * bout.c (b_out_write_object_contents): Don't use sizeof on host + structs to size on-disk structures. + (b_out_set_section_contents): Size the external struct, not the + internal one for on-disk size. + (b_out_sizeof_headers): Likewise. + +2005-03-01 Alan Modra <amodra@bigpond.net.au> + * elf64-ppc.c (ppc64_elf_size_stubs): Override defined dot-sym entry points with the func descriptor as well as undefweak. @@ -297,12 +297,10 @@ b_out_write_object_contents (abfd) exec_hdr (abfd)->a_text = obj_textsec (abfd)->size; exec_hdr (abfd)->a_data = obj_datasec (abfd)->size; exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->size; - exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * sizeof (struct nlist); + exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * 12; exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd); - exec_hdr (abfd)->a_trsize = ((obj_textsec (abfd)->reloc_count) * - sizeof (struct relocation_info)); - exec_hdr (abfd)->a_drsize = ((obj_datasec (abfd)->reloc_count) * - sizeof (struct relocation_info)); + exec_hdr (abfd)->a_trsize = (obj_textsec (abfd)->reloc_count) * 8; + exec_hdr (abfd)->a_drsize = (obj_datasec (abfd)->reloc_count) * 8; exec_hdr (abfd)->a_talign = obj_textsec (abfd)->alignment_power; exec_hdr (abfd)->a_dalign = obj_datasec (abfd)->alignment_power; @@ -993,7 +991,7 @@ b_out_set_section_contents (abfd, section, location, offset, count) if (! aout_32_make_sections (abfd)) return FALSE; - obj_textsec (abfd)->filepos = sizeof (struct internal_exec); + obj_textsec (abfd)->filepos = sizeof (struct external_exec); obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos + obj_textsec (abfd)->size; } @@ -1044,7 +1042,7 @@ b_out_sizeof_headers (ignore_abfd, ignore) bfd *ignore_abfd ATTRIBUTE_UNUSED; bfd_boolean ignore ATTRIBUTE_UNUSED; { - return sizeof (struct internal_exec); + return sizeof (struct external_exec); } |