From: Jim Blandy <jimb@zwingli.cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: explain loading symbols from relocatable files
Date: Wed, 29 Aug 2001 10:43:00 -0000 [thread overview]
Message-ID: <20010829174417.6CE785E9D8@zwingli.cygnus.com> (raw)
2001-08-29 Jim Blandy <jimb@redhat.com>
* gdb.texinfo (`add-symbol-file'): Correct synopsis.
Explain what it means to load relocatable files.
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/doc/gdb.texinfo,v
retrieving revision 2.261
diff -c -r2.261 gdb.texinfo
*** gdb/doc/gdb.texinfo 2001/08/29 04:06:56 2.261
--- gdb/doc/gdb.texinfo 2001/08/29 17:40:43
***************
*** 8858,8864 ****
@cindex dynamic linking
@item add-symbol-file @var{filename} @var{address}
@itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]} @r{[} -mapped @r{]}
! @itemx add-symbol-file @var{filename} @r{-s}@var{section} @var{address}
The @code{add-symbol-file} command reads additional symbol table
information from the file @var{filename}. You would use this command
when @var{filename} has been dynamically loaded (by some other means)
--- 8858,8864 ----
@cindex dynamic linking
@item add-symbol-file @var{filename} @var{address}
@itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]} @r{[} -mapped @r{]}
! @itemx add-symbol-file @var{filename} @r{-s}@var{section} @var{address} @dots{}
The @code{add-symbol-file} command reads additional symbol table
information from the file @var{filename}. You would use this command
when @var{filename} has been dynamically loaded (by some other means)
***************
*** 8874,8879 ****
--- 8874,8913 ----
@code{add-symbol-file} command any number of times; the new symbol data
thus read keeps adding to the old. To discard all old symbol data
instead, use the @code{symbol-file} command without any arguments.
+
+ @cindex relocatable object files, reading symbols from
+ @cindex object files, relocatable, reading symbols from
+ @cindex reading symbols from relocatable object files
+ @cindex symbols, reading from relocatable object files
+ @cindex .o files, reading symbols from
+ Although @var{filename} is typically a shared library file, an
+ executable file, or some other object file which has been fully
+ relocated for loading into a process, you can also load symbolic
+ information from relocatable @file{.o} files, as long as:
+
+ @itemize @bullet
+ @item
+ the file's symbolic information refers only to linker symbols defined in
+ that file, not to symbols defined by other object files,
+ @item
+ every section the file's symbolic information refers to has actually
+ been loaded into the inferior, as it appears in the file, and
+ @item
+ you can determine the address at which every section was loaded, and
+ provide these to the @code{add-symbol-file} command.
+ @end itemize
+
+ @noindent
+ Some embedded operating systems, like Sun Chorus and VxWorks, can load
+ relocatable files into an already running program; such systems
+ typically make the requirements above easy to meet. However, it's
+ important to recognize that many native systems use complex link
+ procedures (@code{.linkonce} section factoring and C++ constructor table
+ assembly, for example) that make the requirements difficult to meet. In
+ general, one cannot assume that using @code{add-symbol-file} to read a
+ relocatable object file's symbolic information will have the same effect
+ as linking the relocatable object file into the program in the normal
+ way.
@code{add-symbol-file} does not repeat if you press @key{RET} after using it.
next reply other threads:[~2001-08-29 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-29 10:43 Jim Blandy [this message]
2001-08-29 11:33 ` Eli Zaretskii
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=20010829174417.6CE785E9D8@zwingli.cygnus.com \
--to=jimb@zwingli.cygnus.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