This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] PR/9723: gdb breakpoints silently fail on PIE binaries
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Thiago Jung Bauermann <thiago dot bauermann at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 27 Jul 2009 17:09:34 -0700
- Subject: Re: [RFC] PR/9723: gdb breakpoints silently fail on PIE binaries
- References: <200907272021.30201.thiago.bauermann@gmail.com>
On Mon, Jul 27, 2009 at 4:21 PM, Thiago Jung
Bauermann<thiago.bauermann@gmail.com> wrote:
+ if (fread (&elfhdr32, sizeof (elfhdr32), 1, fp) != 1)
+ error (_("blah"));
Probably a more informative error is called for here :-)
+ is_pie = (*((uint16_t *) elfhdr32.e_type) == ET_DYN)? 1 : 0;
Wouldn't this fail when host and target have different byte order?
I think you may need to call elf_swap_ehdr_in here.
Cheers,
--
Paul Pluzhnikov