| OLD | NEW | 
|---|
| 1 /* Handle TIC6X (DSBT) shared libraries for GDB, the GNU Debugger. | 1 /* Handle TIC6X (DSBT) shared libraries for GDB, the GNU Debugger. | 
| 2    Copyright (C) 2010-2012 Free Software Foundation, Inc. | 2    Copyright (C) 2010-2012 Free Software Foundation, Inc. | 
| 3 | 3 | 
| 4    This file is part of GDB. | 4    This file is part of GDB. | 
| 5 | 5 | 
| 6    This program is free software; you can redistribute it and/or modify | 6    This program is free software; you can redistribute it and/or modify | 
| 7    it under the terms of the GNU General Public License as published by | 7    it under the terms of the GNU General Public License as published by | 
| 8    the Free Software Foundation; either version 3 of the License, or | 8    the Free Software Foundation; either version 3 of the License, or | 
| 9    (at your option) any later version. | 9    (at your option) any later version. | 
| 10 | 10 | 
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 225 /* Decode int_elf32_dsbt_loadmap from BUF.  */ | 225 /* Decode int_elf32_dsbt_loadmap from BUF.  */ | 
| 226 | 226 | 
| 227 static struct int_elf32_dsbt_loadmap * | 227 static struct int_elf32_dsbt_loadmap * | 
| 228 decode_loadmap (gdb_byte *buf) | 228 decode_loadmap (gdb_byte *buf) | 
| 229 { | 229 { | 
| 230   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); | 230   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); | 
| 231   struct ext_elf32_dsbt_loadmap *ext_ldmbuf; | 231   struct ext_elf32_dsbt_loadmap *ext_ldmbuf; | 
| 232   struct int_elf32_dsbt_loadmap *int_ldmbuf; | 232   struct int_elf32_dsbt_loadmap *int_ldmbuf; | 
| 233 | 233 | 
| 234   int version, seg, nsegs; | 234   int version, seg, nsegs; | 
| 235   int ext_ldmbuf_size, int_ldmbuf_size; | 235   int int_ldmbuf_size; | 
| 236 | 236 | 
| 237   ext_ldmbuf = (struct ext_elf32_dsbt_loadmap *) buf; | 237   ext_ldmbuf = (struct ext_elf32_dsbt_loadmap *) buf; | 
| 238 | 238 | 
| 239   /* Extract the version.  */ | 239   /* Extract the version.  */ | 
| 240   version = extract_unsigned_integer (ext_ldmbuf->version, | 240   version = extract_unsigned_integer (ext_ldmbuf->version, | 
| 241                                       sizeof ext_ldmbuf->version, | 241                                       sizeof ext_ldmbuf->version, | 
| 242                                       byte_order); | 242                                       byte_order); | 
| 243   if (version != 0) | 243   if (version != 0) | 
| 244     { | 244     { | 
| 245       /* We only handle version 0.  */ | 245       /* We only handle version 0.  */ | 
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 834   info->interp_plt_sect_high = 0; | 834   info->interp_plt_sect_high = 0; | 
| 835 | 835 | 
| 836   /* Find the .interp section; if not found, warn the user and drop | 836   /* Find the .interp section; if not found, warn the user and drop | 
| 837      into the old breakpoint at symbol code.  */ | 837      into the old breakpoint at symbol code.  */ | 
| 838   interp_sect = bfd_get_section_by_name (exec_bfd, ".interp"); | 838   interp_sect = bfd_get_section_by_name (exec_bfd, ".interp"); | 
| 839   if (interp_sect) | 839   if (interp_sect) | 
| 840     { | 840     { | 
| 841       unsigned int interp_sect_size; | 841       unsigned int interp_sect_size; | 
| 842       gdb_byte *buf; | 842       gdb_byte *buf; | 
| 843       bfd *tmp_bfd = NULL; | 843       bfd *tmp_bfd = NULL; | 
| 844       int status; | 844       CORE_ADDR addr; | 
| 845       CORE_ADDR addr, interp_loadmap_addr; |  | 
| 846       gdb_byte addr_buf[TIC6X_PTR_SIZE]; | 845       gdb_byte addr_buf[TIC6X_PTR_SIZE]; | 
| 847       struct int_elf32_dsbt_loadmap *ldm; | 846       struct int_elf32_dsbt_loadmap *ldm; | 
| 848       volatile struct gdb_exception ex; | 847       volatile struct gdb_exception ex; | 
| 849 | 848 | 
| 850       /* Read the contents of the .interp section into a local buffer; | 849       /* Read the contents of the .interp section into a local buffer; | 
| 851          the contents specify the dynamic linker this program uses.  */ | 850          the contents specify the dynamic linker this program uses.  */ | 
| 852       interp_sect_size = bfd_section_size (exec_bfd, interp_sect); | 851       interp_sect_size = bfd_section_size (exec_bfd, interp_sect); | 
| 853       buf = alloca (interp_sect_size); | 852       buf = alloca (interp_sect_size); | 
| 854       bfd_get_section_contents (exec_bfd, interp_sect, | 853       bfd_get_section_contents (exec_bfd, interp_sect, | 
| 855                                 buf, 0, interp_sect_size); | 854                                 buf, 0, interp_sect_size); | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1022    is needed.  */ | 1021    is needed.  */ | 
| 1023 | 1022 | 
| 1024 static void | 1023 static void | 
| 1025 dsbt_special_symbol_handling (void) | 1024 dsbt_special_symbol_handling (void) | 
| 1026 { | 1025 { | 
| 1027 } | 1026 } | 
| 1028 | 1027 | 
| 1029 static void | 1028 static void | 
| 1030 dsbt_relocate_main_executable (void) | 1029 dsbt_relocate_main_executable (void) | 
| 1031 { | 1030 { | 
| 1032   int status; |  | 
| 1033   CORE_ADDR exec_addr, interp_addr; |  | 
| 1034   struct int_elf32_dsbt_loadmap *ldm; | 1031   struct int_elf32_dsbt_loadmap *ldm; | 
| 1035   struct cleanup *old_chain; | 1032   struct cleanup *old_chain; | 
| 1036   struct section_offsets *new_offsets; | 1033   struct section_offsets *new_offsets; | 
| 1037   int changed; | 1034   int changed; | 
| 1038   struct obj_section *osect; | 1035   struct obj_section *osect; | 
| 1039   struct dsbt_info *info = get_dsbt_info (); | 1036   struct dsbt_info *info = get_dsbt_info (); | 
| 1040 | 1037 | 
| 1041   dsbt_get_initial_loadmaps (); | 1038   dsbt_get_initial_loadmaps (); | 
| 1042   ldm = info->exec_loadmap; | 1039   ldm = info->exec_loadmap; | 
| 1043 | 1040 | 
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1188   /* Debug this file's internals.  */ | 1185   /* Debug this file's internals.  */ | 
| 1189   add_setshow_zinteger_cmd ("solib-dsbt", class_maintenance, | 1186   add_setshow_zinteger_cmd ("solib-dsbt", class_maintenance, | 
| 1190                             &solib_dsbt_debug, _("\ | 1187                             &solib_dsbt_debug, _("\ | 
| 1191 Set internal debugging of shared library code for DSBT ELF."), _("\ | 1188 Set internal debugging of shared library code for DSBT ELF."), _("\ | 
| 1192 Show internal debugging of shared library code for DSBT ELF."), _("\ | 1189 Show internal debugging of shared library code for DSBT ELF."), _("\ | 
| 1193 When non-zero, DSBT solib specific internal debugging is enabled."), | 1190 When non-zero, DSBT solib specific internal debugging is enabled."), | 
| 1194                             NULL, | 1191                             NULL, | 
| 1195                             show_dsbt_debug, | 1192                             show_dsbt_debug, | 
| 1196                             &setdebuglist, &showdebuglist); | 1193                             &setdebuglist, &showdebuglist); | 
| 1197 } | 1194 } | 
| OLD | NEW | 
|---|