This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld - references to merged SEC_MERGED .debug_str not adjusted
- From: Paul Shortis <pshortis at dataworx dot com dot au>
- To: binutils at sourceware dot org
- Date: Wed, 14 May 2014 08:56:13 +1000
- Subject: ld - references to merged SEC_MERGED .debug_str not adjusted
- Authentication-results: sourceware.org; auth=none
- Reply-to: pshortis at dataworx dot com dot au
I've ported bfd, gas etc to my custom processor, and all is
functioning well with one exception ...
I've trimmed down a test case to ...
#include <stdio.h>
int main( int argc, char *argv[])
{
return 0;
}
The object file produced by gcc/gas looks fine with indirect
string offsets in .debug_info pointing to the correct places in
.debug_str .
However after linking to create a binary, dumping the binary
reveals that unused entries in .debug_str have been deleted (I
assume because this is a SEC_MERGE section), however the indirect
string offsets in .debug_info that point into .debug_str haven't
been adjusted and are therefore invalid.
gdb, of course objects to loading the linked binary.
I've started stepping through ld execution to see what is
happening but I could lose a few days familiarizing myself with
the internals.
I'm assuming I'm repeating some sort of a newbie blunder but
Google hasn't been helpful. Doesn't anyone have any pointers that
may get me closer to a solution to the problem ?
Thanks, Paul.