summaryrefslogtreecommitdiff
path: root/devdocs/go/debug%2Fplan9obj%2Findex.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/go/debug%2Fplan9obj%2Findex.html
new repository
Diffstat (limited to 'devdocs/go/debug%2Fplan9obj%2Findex.html')
-rw-r--r--devdocs/go/debug%2Fplan9obj%2Findex.html87
1 files changed, 87 insertions, 0 deletions
diff --git a/devdocs/go/debug%2Fplan9obj%2Findex.html b/devdocs/go/debug%2Fplan9obj%2Findex.html
new file mode 100644
index 00000000..d4abc113
--- /dev/null
+++ b/devdocs/go/debug%2Fplan9obj%2Findex.html
@@ -0,0 +1,87 @@
+<h1> Package plan9obj </h1> <ul id="short-nav">
+<li><code>import "debug/plan9obj"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package plan9obj implements access to Plan 9 a.out object files. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
+</li>
+<li> <a href="#File.Symbols">func (f *File) Symbols() ([]Sym, error)</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li><a href="#Section">type Section</a></li>
+<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#SectionHeader">type SectionHeader</a></li>
+<li><a href="#Sym">type Sym</a></li>
+</ul> <h3>Package files</h3> <p> <span>file.go</span> <span>plan9obj.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ Magic64 = 0x8000 // 64-bit expanded header
+
+ Magic386 = (4*11+0)*11 + 7
+ MagicAMD64 = (4*26+0)*26 + 7 + Magic64
+ MagicARM = (4*20+0)*20 + 7
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrNoSymbols is returned by <a href="#File.Symbols">File.Symbols</a> if there is no such section in the File. </p>
+<pre data-language="go">var ErrNoSymbols = errors.New("no symbol section")</pre> <h2 id="File">type <span>File</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A File represents an open Plan 9 a.out file. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ Sections []*Section
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing a Plan 9 binary in an underlying reader. The Plan 9 binary is expected to start at position 0 in the ReaderAt. </p>
+<h3 id="Open">func <span>Open</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as a Plan 9 a.out binary. </p>
+<h3 id="File.Close">func (*File) <span>Close</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
+<h3 id="File.Section">func (*File) <span>Section</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns a section with the given name, or nil if no such section exists. </p>
+<h3 id="File.Symbols">func (*File) <span>Symbols</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Symbols() ([]Sym, error)</pre> <p>Symbols returns the symbol table for f. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A FileHeader represents a Plan 9 a.out file header. </p>
+<pre data-language="go">type FileHeader struct {
+ Magic uint32
+ Bss uint32
+ Entry uint64
+ PtrSize int
+ LoadAddress uint64 // Go 1.4
+ HdrSize uint64 // Go 1.4
+}
+</pre> <h2 id="Section">type <span>Section</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A Section represents a single section in a Plan 9 a.out file. </p>
+<pre data-language="go">type Section struct {
+ SectionHeader
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Section.Data">func (*Section) <span>Data</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the Plan 9 a.out section. </p>
+<h3 id="Section.Open">func (*Section) <span>Open</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the Plan 9 a.out section. </p>
+<h2 id="SectionHeader">type <span>SectionHeader</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A SectionHeader represents a single Plan 9 a.out section header. This structure doesn't exist on-disk, but eases navigation through the object file. </p>
+<pre data-language="go">type SectionHeader struct {
+ Name string
+ Size uint32
+ Offset uint32
+}
+</pre> <h2 id="Sym">type <span>Sym</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A Symbol represents an entry in a Plan 9 a.out symbol table section. </p>
+<pre data-language="go">type Sym struct {
+ Value uint64
+ Type rune
+ Name string
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/plan9obj/" class="_attribution-link">http://golang.org/pkg/debug/plan9obj/</a>
+ </p>
+</div>