* arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr.

* hppa-hpux-tdep.c (hppa_hpux_find_dummy_bpaddr): Likewise.
	* hppa-linux-tdep.c (hppa_linux_find_global_pointer): Use
	obj_section_addr and obj_section_endaddr.
	* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Likewise.
	* hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise.
	* ia64-tdep.c (ia64_find_global_pointer): Likewise.
	(find_extant_func_descr): Likewise.
	* solib-frv.c (frv_relocate_main_executable): Use
	obj_section_addr.
	* xstormy16-tdep.c (xstormy16_find_jmp_table_entry): Use
	obj_section_addr and obj_section_endaddr.
This commit is contained in:
Pedro Alves 2008-08-21 13:19:18 +00:00
parent 2b60860a4c
commit aded6f54f0
9 changed files with 50 additions and 22 deletions

View File

@ -1,3 +1,18 @@
2008-08-21 Pedro Alves <pedro@codesourcery.com>
* arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr.
* hppa-hpux-tdep.c (hppa_hpux_find_dummy_bpaddr): Likewise.
* hppa-linux-tdep.c (hppa_linux_find_global_pointer): Use
obj_section_addr and obj_section_endaddr.
* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Likewise.
* hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise.
* ia64-tdep.c (ia64_find_global_pointer): Likewise.
(find_extant_func_descr): Likewise.
* solib-frv.c (frv_relocate_main_executable): Use
obj_section_addr.
* xstormy16-tdep.c (xstormy16_find_jmp_table_entry): Use
obj_section_addr and obj_section_endaddr.
2008-08-21 Paul N. Hilfinger <hilfinger@adacore.com>
* NEWS: Amplify last entry on boolean types in Ada.

View File

@ -303,7 +303,8 @@ arm_pc_is_thumb (CORE_ADDR memaddr)
{
struct arm_per_objfile *data;
VEC(arm_mapping_symbol_s) *map;
struct arm_mapping_symbol map_key = { memaddr - sec->addr, 0 };
struct arm_mapping_symbol map_key = { memaddr - obj_section_addr (sec),
0 };
unsigned int idx;
data = objfile_data (sec->objfile, arm_objfile_data_key);

View File

@ -1068,9 +1068,9 @@ hppa_hpux_find_dummy_bpaddr (CORE_ADDR addr)
{
/* First try the lowest address in the section; we can use it as long
as it is "regular" code (i.e. not a stub) */
u = find_unwind_entry (sec->addr);
u = find_unwind_entry (obj_section_addr (sec));
if (!u || u->stub_unwind.stub_type == 0)
return sec->addr;
return obj_section_addr (sec);
/* Otherwise, we need to find a symbol for a regular function. We
do this by walking the list of msymbols in the objfile. The symbol

View File

@ -365,10 +365,12 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
if (osect < faddr_sect->objfile->sections_end)
{
CORE_ADDR addr;
CORE_ADDR addr, endaddr;
addr = osect->addr;
while (addr < osect->endaddr)
addr = obj_section_addr (osect);
endaddr = obj_section_endaddr (osect);
while (addr < endaddr)
{
int status;
LONGEST tag;

View File

@ -912,15 +912,17 @@ hppa64_convert_code_addr_to_fptr (CORE_ADDR code)
ALL_OBJFILE_OSECTIONS (sec->objfile, opd)
{
if (strcmp (opd->the_bfd_section->name, ".opd") == 0)
break;
break;
}
if (opd < sec->objfile->sections_end)
{
CORE_ADDR addr;
for (addr = opd->addr; addr < opd->endaddr; addr += 2 * 8)
{
for (addr = obj_section_addr (opd);
addr < obj_section_endaddr (opd);
addr += 2 * 8)
{
ULONGEST opdaddr;
char tmp[8];
@ -928,7 +930,7 @@ hppa64_convert_code_addr_to_fptr (CORE_ADDR code)
break;
opdaddr = extract_unsigned_integer (tmp, sizeof (tmp));
if (opdaddr == code)
if (opdaddr == code)
return addr - 16;
}
}

View File

@ -61,9 +61,10 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
if (sec < faddr_sec->objfile->sections_end)
{
CORE_ADDR addr = sec->addr;
CORE_ADDR addr = obj_section_addr (sec);
CORE_ADDR endaddr = obj_section_endaddr (sec);
while (addr < sec->endaddr)
while (addr < endaddr)
{
gdb_byte buf[4];
LONGEST tag;

View File

@ -3095,10 +3095,12 @@ ia64_find_global_pointer (CORE_ADDR faddr)
if (osect < faddr_sect->objfile->sections_end)
{
CORE_ADDR addr;
CORE_ADDR addr, endaddr;
addr = osect->addr;
while (addr < osect->endaddr)
addr = obj_section_addr (osect);
endaddr = obj_section_endaddr (osect);
while (addr < endaddr)
{
int status;
LONGEST tag;
@ -3156,10 +3158,12 @@ find_extant_func_descr (CORE_ADDR faddr)
if (osect < faddr_sect->objfile->sections_end)
{
CORE_ADDR addr;
CORE_ADDR addr, endaddr;
addr = osect->addr;
while (addr < osect->endaddr)
addr = obj_section_addr (osect);
endaddr = obj_section_endaddr (osect);
while (addr < endaddr)
{
int status;
LONGEST faddr2;

View File

@ -908,7 +908,7 @@ frv_relocate_main_executable (void)
osect_idx = osect->the_bfd_section->index;
/* Current address of section. */
addr = osect->addr;
addr = obj_section_addr (osect);
/* Offset from where this section started. */
offset = ANOFFSET (symfile_objfile->section_offsets, osect_idx);
/* Original address prior to any past relocations. */

View File

@ -550,9 +550,12 @@ xstormy16_find_jmp_table_entry (CORE_ADDR faddr)
if (osect < faddr_sect->objfile->sections_end)
{
CORE_ADDR addr;
for (addr = osect->addr;
addr < osect->endaddr; addr += 2 * xstormy16_inst_size)
CORE_ADDR addr, endaddr;
addr = obj_section_addr (osect);
endaddr = obj_section_endaddr (osect);
for (; addr < endaddr; addr += 2 * xstormy16_inst_size)
{
LONGEST inst, inst2, faddr2;
char buf[2 * xstormy16_inst_size];