diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-06-06 23:33:00 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2003-06-06 23:33:00 +0000 |
commit | a39a16c41b7a27c34abdf6f5c32c4a89b5ac35c6 (patch) | |
tree | 02417c41a9e7e49238d9178d45173cfd6ae8c6dc /gdb/remote.c | |
parent | 539ee71a87838a10f843d7b1ef64975afba1b20e (diff) | |
download | gdb-a39a16c41b7a27c34abdf6f5c32c4a89b5ac35c6.zip gdb-a39a16c41b7a27c34abdf6f5c32c4a89b5ac35c6.tar.gz gdb-a39a16c41b7a27c34abdf6f5c32c4a89b5ac35c6.tar.bz2 |
* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
(elfstab_offset_sections): Likewise.
* gdb-stabs.h (stab_section_info): Likewise.
* i386-interix-tdep.c (pei_adjust_objfile_offsets): Likewise.
* objfiles.c (objfile_relocate): Likewise.
* pa64solib.c (pa64_solib_add_solib_objfile): Likewise.
* remote.c (get_offsets): Likewise.
(remote_cisco_objfile_relocate): Likewise.
* somread.c (som_symfile_offsets): Likewise.
* symfile.c (alloc_section_addr_info): New function.
(build_section_addr_info_from_section_tab): Use it.
(free_section_addr_info): Adjust.
(default_symfile_offsets): Avoid use of SECT_OFF_MAX.
(syms_from_objfile): Allocate local_addr dynamically.
(symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs
dynamically.
(add_symbol_file_command): Allocate sect_opts dynamically.
(reread_symbols): Avoid use of SECT_OFF_MAX.
* symfile.h (section_addr_info): Do not use MAX_SECTIONS.
(alloc_section_addr_info): Declare it.
* symtab.h (SIZEOF_SECTION_OFFSETS): Remove.
* win32-nat.c (solib_symbols_add): Allocate section_addrs
dynamically.
* xcoffread.c (xcoff_symfile_offsets): Avoid use of SECT_OFF_MAX.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index e55e141..2adbc13 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1989,8 +1989,10 @@ get_offsets (void) if (symfile_objfile == NULL) return; - offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); - memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS); + offs = ((struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections))); + memcpy (offs, symfile_objfile->section_offsets, + SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr; @@ -2101,8 +2103,10 @@ remote_cisco_objfile_relocate (bfd_signed_vma text_off, bfd_signed_vma data_off, broken for xcoff, dwarf, sdb-coff, etc. But there is no simple canonical representation for this stuff. */ - offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); - memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS); + offs = (struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); + memcpy (offs, symfile_objfile->section_offsets, + SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_off; offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_off; |