This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Preserve the original p_align and p_flags if they are valid


The full context is we run stripped binaries on the target and use
gdbserver to talk to gdb on the host which can access the non-stripped
binaries. However, gdb appears to verify the program headers in memory
against the binary on disk first and will reject the symbols because
of the difference from the PT_GNU_RELRO section:

non-stripped:
 GNU_RELRO      0x002dfc 0x00003dfc 0x00003dfc 0x00204 0x00204 RW  0x4

stripped:
 GNU_RELRO      0x002dfc 0x00003dfc 0x00003dfc 0x00204 0x00204 R   0x1

With the patch the attributes for the PT_GNU_RELRO section won't be
unconditionally changed by objcopy and strip.

Thanks,
-Ben

On Mon, May 7, 2012 at 6:03 AM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, May 04, 2012 at 01:59:47PM -0700, Ben Cheng wrote:
>> + ? ? ? ? ?/* Preserve the alignment and flags if they are valid. The gold
>> + ? ? ? ? ? ? linker generates RW/4 for the PT_GNU_RELRO section. It is better
>> + ? ? ? ? ? ? for objcopy/strip to honor these attributes otherwise gdb will
>> + ? ? ? ? ? ? choke when doing cross-debugging. */
>
> I don't see what this has to do with cross-debugging. ?Did you mean to
> say "... when using separate debug files."?
>
> --
> Alan Modra
> Australia Development Lab, IBM


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