This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] objfiles.c:objfile_relocate: Handle entry_point in section other than .text


Committed.

> GDB is unable to call functions in executables which are compiled with
> maxdata > 256 MB on AIX.
> A typescript of a failing GDB session is appended below after the
> suggested patch.
> 
> 
> The failure is caused due to the peculiar o_entry definition on AIX:
> 
> o_entry: Specifies the virtual address of the entry point.
> For application programs, this virtual address is the address of the function
> descriptor. The function descriptor contains the addresses of both the entry
> point itself and its TOC anchor.
> 
> 
> bfd_get_start_address() returns the address from o_entry, which means that
> we get the address of the entry function descriptor, which usually lives in
> the .data segment.
> This (eventually relocated) value is used as the return value from
> entry_point_address(), which is used for the call dummy breakpoint address.
> 
> For call dummy purposes, it doesn't matter that we put the breakpoint
> at the function descriptor of the entry point and not at the entry point
> itself.
> 
> The problem arises when the .data segment is relocated, as ei.entry_point
> is always relocated with SECT_OFF_TEXT.
> 
> Here is a patch:
> 
> 	* objfiles.c (objfile_relocate):  Relocate ei.entry_point with
> 	its section offset, use SECT_OFF_TEXT only as a fallback.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]