From: Steven Johnson <sjohnson@sakuraindustries.com>
Cc: gdb@sources.redhat.com, frederic.riss@st.com
Subject: Re: Problems with startup code symbols (Copious warnings)
Date: Mon, 19 Jun 2006 10:00:00 -0000 [thread overview]
Message-ID: <4496702C.9030607@sakuraindustries.com> (raw)
In-Reply-To: <vt2mzcfxonz.fsf@theseus.home.>
Jim Blandy wrote:
>Jim Blandy <jimb@codesourcery.com> writes:
>
>
>>Steven Johnson <sjohnson@sakuraindustries.com> writes:
>>
>>
>>>Will post an app tomorrow that does this, once I've made one.
>>>
>>>
>>I see your post in the archive, but for some reason it didn't reach
>>me. I'll take a look.
>>
>>
>
>Okay. I think I understand part of the problem.
>
>If you run 'readelf -wi' on your executable, you should see two
>DW_TAG_compile_unit entries. Each has DW_AT_high_pc and DW_AT_low_pc
>attributes. The DWARF data claims that the crt0.c compilation unit
>covers addresses zero to zero, and that the vectors.S compilation unit
>covers addresses from zero to 0x104.
>
>
Well that was a problem. crt0.c shouldn't have been there, I got rid of
it with -nostartfiles. Now its not present in the readelf -wi, i only
have vectors.s covering the range 0-0x104. It doesn't change the
problem, so its probably down to the link-once stuff below.
>Then, each of them has a DW_AT_stmt_list that points to line number
>information, which you can dump with 'readelf -wl'. The crt0.c line
>number info definitely seems to cover addresses outside the range
>given in the crt0.c DW_TAG_compile_unit entry. Which is odd. Where
>did the code from crt0.c really go?
>
>
Don't know, it shouldn't have been there in the first place. I've never
noticed it before in debugging, because it seems only its debug info was
hanging around, no code from it seems to be in my projects???
>Is there some reason relocs against the debugging information aren't
>getting applied? I didn't quite get everything that was going on in
>your link line.
>
>
You have lost me here, I don't know what you mean? Specifically, I
don't understand "relocs against the debugging information aren't
getting applied"?
>The other part of the problem is that GDB distrusts DW_AT_low_pc
>attributes whose values are zero, presuming that they refer to a
>discarded 'linkonce' section. Here's the code:
>
> /* When using the GNU linker, .gnu.linkonce. sections are used to
> eliminate duplicate copies of functions and vtables and such.
> The linker will arbitrarily choose one and discard the others.
> The AT_*_pc values for such functions refer to local labels in
> these sections. If the section from that file was discarded, the
> labels are not in the output, so the relocs get a value of 0.
> If this is a discarded function, mark the pc bounds as invalid,
> so that GDB will ignore it. */
> if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0)
> return 0;
>
>
This is without question what is breaking my debug session. I commented
out this code and all works fine, and the error goes away. I also
dumped the assumed discarded bfd information, to see if there was any
difference in my main project with the original code and any .linkonce
sections in it that could be identified, but it turns out I don't have
any .linkonce sections in my project.
I was about to suggest a flag that conditions off this test, instead of
the warning. However I then received Freds post, and if that would
work, it would be better, cause it is automatic. Unfortunately I am
quite lost here and wouldn't even know where to begin to check "If one
loadable section has a VMA of 0" otherwise I would throw a test together
to see if it fixed it.
Steven J
prev parent reply other threads:[~2006-06-19 9:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-08 7:23 Steven Johnson
2006-06-08 9:06 ` Jim Blandy
2006-06-08 12:25 ` Steven Johnson
2006-06-08 23:10 ` Steven Johnson
2006-06-15 0:12 ` Jim Blandy
2006-06-15 7:33 ` Jim Blandy
2006-06-19 9:36 ` Frederic RISS
2006-06-20 12:23 ` Daniel Jacobowitz
2006-06-20 12:33 ` Frederic RISS
2006-06-20 12:56 ` Daniel Jacobowitz
2006-06-20 13:09 ` Frederic RISS
2006-06-20 20:17 ` Steven Johnson
2006-06-20 23:35 ` Daniel Jacobowitz
2006-06-21 8:54 ` Frederic RISS
2006-06-21 14:44 ` Steven Johnson
2006-06-21 15:28 ` Daniel Jacobowitz
2006-06-19 10:00 ` Steven Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4496702C.9030607@sakuraindustries.com \
--to=sjohnson@sakuraindustries.com \
--cc=frederic.riss@st.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox