From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: PATCH: Add FIXME about section offsets in dbxread
Date: Sat, 13 Sep 2003 00:03:00 -0000 [thread overview]
Message-ID: <vt2vfrxmu8y.fsf@zenia.home> (raw)
2003-09-12 Jim Blandy <jimb@redhat.com>
* dbxread.c (read_dbx_symtab): Add FIXME about finding section
offsets for global and static variables.
Index: gdb/dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.51
diff -c -r1.51 dbxread.c
*** gdb/dbxread.c 12 Sep 2003 22:49:25 -0000 1.51
--- gdb/dbxread.c 12 Sep 2003 23:31:37 -0000
***************
*** 1357,1363 ****
textlow_not_set = 1;
has_line_numbers = 0;
! /* If the objfile has no .data section, try using the .bss section. */
data_sect_index = objfile->sect_index_data;
if (data_sect_index == -1)
data_sect_index = SECT_OFF_BSS (objfile);
--- 1357,1382 ----
textlow_not_set = 1;
has_line_numbers = 0;
! /* FIXME: jimb/2003-09-12: We don't apply the right section's offset
! to global and static variables. The stab for a global or static
! variable doesn't give us any indication of which section it's in,
! so we can't tell immediately which offset in
! objfile->section_offsets we should apply to the variable's
! address.
!
! We could certainly find out which section contains the variable
! by looking up the variable's unrelocated address with
! find_pc_section, but that would be expensive; this is the
! function that constructs the partial symbol tables by examining
! every symbol in the entire executable, and it's
! performance-critical. So that expense would not be welcome. I'm
! not sure what to do about this at the moment.
!
! What we have done for years is to simply assume that the .data
! section's offset is appropriate for all global and static
! variables. Recently, this was expanded to fall back to the .bss
! section's offset if there is no .data section, and then to the
! .rodata section's offset. */
data_sect_index = objfile->sect_index_data;
if (data_sect_index == -1)
data_sect_index = SECT_OFF_BSS (objfile);
reply other threads:[~2003-09-13 0:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=vt2vfrxmu8y.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=gdb-patches@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