From: Fred Fish Date: Fri, 18 Jun 1993 19:15:45 +0000 (+0000) Subject: * stabs.texinfo: Add some basic info about stabs-in-elf. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc4fb84844bdb1a0a1c4aa5a8fa770442b7477ce;p=binutils-gdb.git * stabs.texinfo: Add some basic info about stabs-in-elf. (this may require attention from a tex/texinfo wizard..) --- diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 9494bed1df6..2012e69d715 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +Fri Jun 18 12:12:57 1993 Fred Fish (fnf@cygnus.com) + + * stabs.texinfo: Add some basic info about stabs-in-elf. + Fri Jun 18 13:57:09 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * stabs.texinfo (Top): Minor cleanup. diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index 46fc747a608..2995ac17a13 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -3855,5 +3855,49 @@ new type defined in the compilation. GNU C stabs use the type number alone, with no source file number. @end itemize +@node stabs-in-elf +@appendix Using stabs with the ELF object file format. + +The ELF object file format allows tools to create object files with custom +sections containing any arbitrary data. To use stabs in ELF object files, +the tools create two custom sections, a ".stab" section which contains +an array of fixed length structures, one struct per stab, and a ".stabstr" +section containing all the variable length strings that are referenced by +stabs in the ".stab" section. + +The first stab in the ".stab" section for each object file is a "synthetic +stab", generated entirely by the assembler, with no corresponding ".stab" +directive as input to the assembler. This stab contains the following +fields: + +@itemize @bullet +@item +Offset in the ".stabstr" section to the source filename. + +@item +N_UNDF + +@item +Unused field, always zero. + +@item +Count of upcoming symbols. I.E. the number of remaining stabs for this +object module. + +@item +Size of the string table fragment associated with this object module, in +bytes. + +@end itemize + +The ".stabstr" section always starts with a null byte (so that string +offsets of zero reference a null string), followed by random length strings, +each of which is null byte terminated. + +The ELF section header for the ".stab" section has it's sh_link member set +to the section number of the ".stabstr" section, and the ".stabstr" section +has it's ELF section header sh_type member set to SHT_STRTAB to mark it as +a string table. + @contents @bye