Gentoo Archives: gentoo-commits

From: Francisco Blas Izquierdo Riera <klondike@×××××××××.es>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-docs:master commit in: xml/
Date: Sat, 28 Apr 2012 19:23:35
Message-Id: 1335640924.f756acec0e3a45939cc506f996bb2bfd71c0bfa4.klondike@gentoo
1 commit: f756acec0e3a45939cc506f996bb2bfd71c0bfa4
2 Author: klondike <klondike <AT> xiscosoft <DOT> es>
3 AuthorDate: Sat Apr 28 19:22:04 2012 +0000
4 Commit: Francisco Blas Izquierdo Riera <klondike <AT> xiscosoft <DOT> es>
5 CommitDate: Sat Apr 28 19:22:04 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-docs.git;a=commit;h=f756acec
7
8 Fix bug #413289
9
10 ---
11 xml/hardened-debugging.xml | 12 +-
12 xml/revdep-pax.xml | 616 +++-----------------------------------------
13 2 files changed, 43 insertions(+), 585 deletions(-)
14
15 diff --git a/xml/hardened-debugging.xml b/xml/hardened-debugging.xml
16 index 21a0fc9..0a648a9 100644
17 --- a/xml/hardened-debugging.xml
18 +++ b/xml/hardened-debugging.xml
19 @@ -5,7 +5,7 @@
20 <guide link="/proj/en/hardened/hardenedfaq.xml" lang="en">
21 <title>Gentoo Hardened debugging</title>
22 <author title="Author">
23 - <mail link="klondike@×××××××××.es">klondike</mail>
24 + <mail link="klondike"/>
25 </author>
26 <author title="Contributor">
27 <!-- Via bugs #341889 and 265693 -->
28 @@ -21,8 +21,8 @@ hardened kernel and toolcahin with PaX/Grsec, PIE and SSP.
29 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
30 <license/>
31
32 -<version>1.0</version>
33 -<date>2010-10-26</date>
34 +<version>2</version>
35 +<date>2012-04-28</date>
36
37 <chapter>
38 <title>Solving the '??' issue.</title>
39 @@ -214,10 +214,12 @@ available breakpoints.
40 <p>
41 After debugging you may want to restore the system to its normal state, if you
42 used <c>paxctl</c> you can reset the flags to default using the <c>-z</c> flag.
43 +Since the -z flags will zero all the flags also want to keep trampoline
44 +emulation disabled. This is done with the <c>-e</c> flag.
45 </p>
46
47 -<pre caption="Reseting the flags back to its defaults.">
48 -# <i>paxctl -z binary</i>
49 +<pre caption="Reseting the flags back to its defaults. Keep trampoline emulation disabled">
50 +# <i>paxctl -ze binary</i>
51 </pre>
52
53 </body>
54
55 diff --git a/xml/revdep-pax.xml b/xml/revdep-pax.xml
56 index ba9f822..cbf3181 100644
57 --- a/xml/revdep-pax.xml
58 +++ b/xml/revdep-pax.xml
59 @@ -23,7 +23,10 @@ requiring RWX memory in order to process JIT code.
60 <date>2012-02-19</date>
61
62 <chapter>
63 -<title>What's <c>revdep-pax</c> about?</title>
64 +<title>What's revdep-pax about?</title>
65 +
66 +<section>
67 +<body>
68
69 <p by="Geroge Orwell">
70 Since the early days of PaX it was known that all programs were equal although
71 @@ -33,6 +36,9 @@ allowing system administrators and users telling the system which binaries
72 needed this lessened environment the PaX marks were created.
73 </p>
74
75 +</body>
76 +</section>
77 +
78 <section>
79 <title>A quick introduction to PaX markings.</title>
80 <body>
81 @@ -106,7 +112,7 @@ called. In order to solve this issue we have created <c>revdep-pax</c>.
82 </body>
83 </section>
84 <section>
85 -<title>What's <c>revdep-pax</c>?</title>
86 +<title>What's revdep-pax?</title>
87 <body>
88
89 <p>
90 @@ -134,7 +140,10 @@ libraries linked by an object and backwards to the objects linked by a library.
91 </chapter>
92
93 <chapter>
94 -<title>Using <c>revdep-pax</c></title>
95 +<title>Using revdep-pax</title>
96 +
97 +<section>
98 +<body>
99
100 <p by="The Emperor">
101 In order to witness the firepower of this fully ARMED and OPERATIONAL tool
102 @@ -142,6 +151,9 @@ you'll first need to learn how to use it, once you are done, you'll be
103 able to fire at will.
104 </p>
105
106 +</body>
107 +</section>
108 +
109 <section>
110 <title>Propagating PaX marks backwards from a library to objects that link at it
111 </title>
112 @@ -149,592 +161,36 @@ able to fire at will.
113
114 <p>
115 This is going to be probably the main way in which you are going to use this
116 -utility. What it does is check all the libraries linked statically
117 -The <c>scanelf</c> application is part of the <c>app-misc/pax-utils</c> package.
118 -With this application you can print out information specific to the ELF
119 -structure of a binary. The following table sums up the various options.
120 -</p>
121 -
122 -<table>
123 -<tr>
124 - <th>Option</th>
125 - <th>Long Option</th>
126 - <th>Description</th>
127 -</tr>
128 -<tr>
129 - <ti>-p</ti>
130 - <ti>--path</ti>
131 - <ti>Scan all directories in PATH environment</ti>
132 -</tr>
133 -<tr>
134 - <ti>-l</ti>
135 - <ti>--ldpath</ti>
136 - <ti>Scan all directories in /etc/ld.so.conf</ti>
137 -</tr>
138 -<tr>
139 - <ti>-R</ti>
140 - <ti>--recursive</ti>
141 - <ti>Scan directories recursively</ti>
142 -</tr>
143 -<tr>
144 - <ti>-m</ti>
145 - <ti>--mount</ti>
146 - <ti>Don't recursively cross mount points</ti>
147 -</tr>
148 -<tr>
149 - <ti>-y</ti>
150 - <ti>--symlink</ti>
151 - <ti>Don't scan symlinks</ti>
152 -</tr>
153 -<tr>
154 - <ti>-A</ti>
155 - <ti>--archives</ti>
156 - <ti>Scan archives (.a files)</ti>
157 -</tr>
158 -<tr>
159 - <ti>-L</ti>
160 - <ti>--ldcache</ti>
161 - <ti>Utilize ld.so.cache information (use with -r/-n)</ti>
162 -</tr>
163 -<tr>
164 - <ti>-X</ti>
165 - <ti>--fix</ti>
166 - <ti>Try and 'fix' bad things (use with -r/-e)</ti>
167 -</tr>
168 -<tr>
169 - <ti>-z [arg]</ti>
170 - <ti>--setpax [arg]</ti>
171 - <ti>Sets EI_PAX/PT_PAX_FLAGS to [arg] (use with -Xx)</ti>
172 -</tr>
173 -<tr>
174 - <th>Option</th>
175 - <th>Long Option</th>
176 - <th>Description</th>
177 -</tr>
178 -<tr>
179 - <ti>-x</ti>
180 - <ti>--pax</ti>
181 - <ti>Print PaX markings</ti>
182 -</tr>
183 -<tr>
184 - <ti>-e</ti>
185 - <ti>--header</ti>
186 - <ti>Print GNU_STACK/PT_LOAD markings</ti>
187 -</tr>
188 -<tr>
189 - <ti>-t</ti>
190 - <ti>--textrel</ti>
191 - <ti>Print TEXTREL information</ti>
192 -</tr>
193 -<tr>
194 - <ti>-r</ti>
195 - <ti>--rpath</ti>
196 - <ti>Print RPATH information</ti>
197 -</tr>
198 -<tr>
199 - <ti>-n</ti>
200 - <ti>--needed</ti>
201 - <ti>Print NEEDED information</ti>
202 -</tr>
203 -<tr>
204 - <ti>-i</ti>
205 - <ti>--interp</ti>
206 - <ti>Print INTERP information</ti>
207 -</tr>
208 -<tr>
209 - <ti>-b</ti>
210 - <ti>--bind</ti>
211 - <ti>Print BIND information</ti>
212 -</tr>
213 -<tr>
214 - <ti>-S</ti>
215 - <ti>--soname</ti>
216 - <ti>Print SONAME information</ti>
217 -</tr>
218 -<tr>
219 - <ti>-s [arg]</ti>
220 - <ti>--symbol [arg]</ti>
221 - <ti>Find a specified symbol</ti>
222 -</tr>
223 -<tr>
224 - <ti>-k [arg]</ti>
225 - <ti>--section [arg]</ti>
226 - <ti>Find a specified section</ti>
227 -</tr>
228 -<tr>
229 - <ti>-N [arg]</ti>
230 - <ti>--lib [arg]</ti>
231 - <ti>Find a specified library</ti>
232 -</tr>
233 -<tr>
234 - <ti>-g</ti>
235 - <ti>--gmatch</ti>
236 - <ti>Use strncmp to match libraries. (use with -N)</ti>
237 -</tr>
238 -<tr>
239 - <ti>-T</ti>
240 - <ti>--textrels</ti>
241 - <ti>Locate cause of TEXTREL</ti>
242 -</tr>
243 -<tr>
244 - <ti>-E [arg]</ti>
245 - <ti>--etype [arg]</ti>
246 - <ti>Print only ELF files matching etype ET_DYN,ET_EXEC ...</ti>
247 -</tr>
248 -<tr>
249 - <ti>-M [arg]</ti>
250 - <ti>--bits [arg]</ti>
251 - <ti>Print only ELF files matching numeric bits</ti>
252 -</tr>
253 -<tr>
254 - <ti>-a</ti>
255 - <ti>--all</ti>
256 - <ti>Print all scanned info (-x -e -t -r -b)</ti>
257 -</tr>
258 -<tr>
259 - <th>Option</th>
260 - <th>Long Option</th>
261 - <th>Description</th>
262 -</tr>
263 -<tr>
264 - <ti>-q</ti>
265 - <ti>--quiet</ti>
266 - <ti>Only output 'bad' things</ti>
267 -</tr>
268 -<tr>
269 - <ti>-v</ti>
270 - <ti>--verbose</ti>
271 - <ti>Be verbose (can be specified more than once)</ti>
272 -</tr>
273 -<tr>
274 - <ti>-F [arg]</ti>
275 - <ti>--format [arg]</ti>
276 - <ti>Use specified format for output</ti>
277 -</tr>
278 -<tr>
279 - <ti>-f [arg]</ti>
280 - <ti>--from [arg]</ti>
281 - <ti>Read input stream from a filename</ti>
282 -</tr>
283 -<tr>
284 - <ti>-o [arg]</ti>
285 - <ti>--file [arg]</ti>
286 - <ti>Write output stream to a filename</ti>
287 -</tr>
288 -<tr>
289 - <ti>-B</ti>
290 - <ti>--nobanner</ti>
291 - <ti>Don't display the header</ti>
292 -</tr>
293 -<tr>
294 - <ti>-h</ti>
295 - <ti>--help</ti>
296 - <ti>Print this help and exit</ti>
297 -</tr>
298 -<tr>
299 - <ti>-V</ti>
300 - <ti>--version</ti>
301 - <ti>Print version and exit</ti>
302 -</tr>
303 -</table>
304 -
305 -<p>
306 -The format specifiers for the <c>-F</c> option are given in the following table.
307 -Prefix each specifier with <c>%</c> (verbose) or <c>#</c> (silent) accordingly.
308 -</p>
309 -
310 -<table>
311 -<tr>
312 - <th>Specifier</th>
313 - <th>Full Name</th>
314 - <th>Specifier</th>
315 - <th>Full Name</th>
316 -</tr>
317 -<tr>
318 - <ti>F</ti>
319 - <ti>Filename</ti>
320 - <ti>x</ti>
321 - <ti>PaX Flags</ti>
322 -</tr>
323 -<tr>
324 - <ti>e</ti>
325 - <ti>STACK/RELRO</ti>
326 - <ti>t</ti>
327 - <ti>TEXTREL</ti>
328 -</tr>
329 -<tr>
330 - <ti>r</ti>
331 - <ti>RPATH</ti>
332 - <ti>n</ti>
333 - <ti>NEEDED</ti>
334 -</tr>
335 -<tr>
336 - <ti>i</ti>
337 - <ti>INTERP</ti>
338 - <ti>b</ti>
339 - <ti>BIND</ti>
340 -</tr>
341 -<tr>
342 - <ti>s</ti>
343 - <ti>Symbol</ti>
344 - <ti>N</ti>
345 - <ti>Library</ti>
346 -</tr>
347 -<tr>
348 - <ti>o</ti>
349 - <ti>Type</ti>
350 - <ti>p</ti>
351 - <ti>File name</ti>
352 -</tr>
353 -<tr>
354 - <ti>f</ti>
355 - <ti>Base file name</ti>
356 - <ti>k</ti>
357 - <ti>Section</ti>
358 -</tr>
359 -<tr>
360 - <ti>a</ti>
361 - <ti>ARCH/e_machine</ti>
362 - <ti>&nbsp;</ti>
363 - <ti>&nbsp;</ti>
364 -</tr>
365 -</table>
366 -
367 -</body>
368 -</section>
369 -<section>
370 -<title>Using scanelf for Text Relocations</title>
371 -<body>
372 -
373 -<p>
374 -As an example, we will use <c>scanelf</c> to find binaries containing text
375 -relocations.
376 -</p>
377 -
378 -<p>
379 -A relocation is an operation that rewrites an address in a loaded segment. Such
380 -an address rewrite can happen when a segment has references to a shared object
381 -and that shared object is loaded in memory. In this case, the references are
382 -substituted with the real address values. Similar events can occur inside the
383 -shared object itself.
384 -</p>
385 -
386 -<p>
387 -A text relocation is a relocation in the text segment. Since text segments
388 -contain executable code, system administrators might prefer not to have these
389 -segments writable. This is perfectly possible, but since text relocations
390 -actually write in the text segment, it is not always feasible.
391 -</p>
392 -
393 -<p>
394 -If you want to eliminate text relocations, you will need to make sure
395 -that the application and shared object is built with <e>Position Independent
396 -Code</e> (PIC), making references obsolete. This not only increases security,
397 -but also increases the performance in case of shared objects (allowing writes in
398 -the text segment requires a swap space reservation and a private copy of the
399 -shared object for each application that uses it).
400 -</p>
401 -
402 -<p>
403 -The following example will search your library paths recursively, without
404 -leaving the mounted file system and ignoring symbolic links, for any ELF binary
405 -containing a text relocation:
406 -</p>
407 -
408 -<pre caption="Scanning the system for text relocation binaries">
409 -# <i>scanelf -lqtmyR</i>
410 -</pre>
411 -
412 -<p>
413 -If you want to scan your entire system for <e>any</e> file containing text
414 -relocations:
415 -</p>
416 -
417 -<pre caption="Scanning the entire system for text relocation files">
418 -# <i>scanelf -qtmyR /</i>
419 -</pre>
420 -
421 -</body>
422 -</section>
423 -<section>
424 -<title>Using scanelf for Specific Header</title>
425 -<body>
426 -
427 -<p>
428 -The scanelf util can be used to quickly identify files that contain a
429 -given section header using the -k .section option.
430 -</p>
431 -
432 -<p>
433 -In this example we are looking for all files in /usr/lib/debug
434 -recursively using a format modifier with quiet mode enabled that have been
435 -stripped. A stripped elf will lack a .symtab entry, so we use the '!'
436 -to invert the matching logic.
437 -</p>
438 -
439 -<pre caption="Scanning for stripped or non stripped executables">
440 -# <i>scanelf -k '!.symtab' /usr/lib/debug -Rq -F%F#k</i>
441 -</pre>
442 -
443 -</body>
444 -</section>
445 -<section>
446 -<title>Using scanelf for Specific Segment Markings</title>
447 -<body>
448 -
449 -<p>
450 -Each segment has specific flags assigned to it in the Program Header of the
451 -binary. One of those flags is the type of the segment. Interesting values are
452 -PT_LOAD (the segment must be loaded in memory from file), PT_DYNAMIC (the
453 -segment contains dynamic linking information), PT_INTERP (the segment
454 -contains the name of the program interpreter), PT_GNU_STACK (a GNU extension
455 -for the ELF format, used by some stack protection mechanisms), and PT_PAX_FLAGS
456 -(a PaX extension for the ELF format, used by the security-minded
457 -<uri link="http://pax.grsecurity.net/">PaX Project</uri>.
458 -</p>
459 -
460 -<p>
461 -If we want to scan all executables in the current working directory, PATH
462 -environment and library paths and report those who have a writable and
463 -executable PT_LOAD or PT_GNU_STACK marking, you could use the following command:
464 -</p>
465 -
466 -<pre caption="Scanning for Write/eXecute flags for PT_LOAD and PT_GNU_STACK">
467 -# <i>scanelf -lpqe .</i>
468 -</pre>
469 -
470 -</body>
471 -</section>
472 -<section>
473 -<title>Using scanelf's Format Modifier Handler</title>
474 -<body>
475 -
476 -<p>
477 -A useful feature of the <c>scanelf</c> utility is the format modifier handler.
478 -With this option you can control the output of <c>scanelf</c>, thereby
479 -simplifying parsing the output with scripts.
480 -</p>
481 -
482 -<p>
483 -As an example, we will use <c>scanelf</c> to print the file names that contain
484 -text relocations:
485 -</p>
486 -
487 -<pre caption="Example of the scanelf format modifier handler">
488 -# <i>scanelf -l -p -R -q -F "%F #t"</i>
489 +utility. What it does is check all the libraries linked statically by the
490 +binaries using <c>ldd</c> and then smartly add the paxmarks of those libraries
491 +to generate the new set. As a result if <path>/usr/games/bin/armagetronad</path>
492 +links with <path>/usr/lib64/libGL.so.1</path> which has the <e>-m</e> PaX mark
493 +(allow RWX mappings) because you are using a llvm requiring graphics driver
494 +you'll get that binary marked with the <e>-m</e> PaX mark too since it needs it.
495 +Below you can see how to run it.
496 +</p>
497 +
498 +<pre caption="Propagating the PaX marks from the libraries">
499 +# <i>mv /etc/grsec/learning.roles /etc/grsec/policy</i>
500 +# <i>chmod 0600 /etc/grsec/policy</i>
501 </pre>
502
503 -</body>
504 -</section>
505 -</chapter>
506 -
507 -<chapter id="pspax">
508 -<title>Listing PaX Flags and Capabilities</title>
509 -<section>
510 -<title>About PaX</title>
511 -<body>
512 -
513 -<p>
514 -<uri link="http://pax.grsecurity.net">PaX</uri> is a project hosted by the <uri
515 -link="http://www.grsecurity.net">grsecurity</uri> project. Quoting the <uri
516 -link="http://pax.grsecurity.net/docs/pax.txt">PaX documentation</uri>, its main
517 -goal is "to research various defense mechanisms against the exploitation of
518 -software bugs that give an attacker arbitrary read/write access to the
519 -attacked task's address space. This class of bugs contains among others
520 -various forms of buffer overflow bugs (be they stack or heap based), user
521 -supplied format string bugs, etc."
522 -</p>
523 -
524 -<p>
525 -To be able to benefit from these defense mechanisms, you need to run a Linux
526 -kernel patched with the latest PaX code. The <uri
527 -link="http://hardened.gentoo.org">Hardened Gentoo</uri> project supports PaX and
528 -its parent project, grsecurity. The supported kernel package is
529 -<c>sys-kernel/hardened-sources</c>.
530 -</p>
531 -
532 -<p>
533 -The Gentoo/Hardened project has a <uri
534 -link="/proj/en/hardened/pax-quickstart.xml">Gentoo PaX Quickstart Guide</uri>
535 -for your reading pleasure.
536 -</p>
537 -
538 -</body>
539 -</section>
540 -<section>
541 -<title>Flags and Capabilities</title>
542 -<body>
543 -
544 -<p>
545 -If your toolchain supports it, your binaries can have additional PaX flags in
546 -their Program Header. The following flags are supported:
547 -</p>
548 -
549 -<table>
550 -<tr>
551 - <th>Flag</th>
552 - <th>Name</th>
553 - <th>Description</th>
554 -</tr>
555 -<tr>
556 - <ti>P</ti>
557 - <ti>PAGEEXEC</ti>
558 - <ti>
559 - Refuse code execution on writable pages based on the NX bit
560 - (or emulated NX bit)
561 - </ti>
562 -</tr>
563 -<tr>
564 - <ti>S</ti>
565 - <ti>SEGMEXEC</ti>
566 - <ti>
567 - Refuse code execution on writable pages based on the
568 - segmentation logic of IA-32
569 - </ti>
570 -</tr>
571 -<tr>
572 - <ti>E</ti>
573 - <ti>EMUTRAMP</ti>
574 - <ti>
575 - Allow known code execution sequences on writable pages that
576 - should not cause any harm
577 - </ti>
578 -</tr>
579 -<tr>
580 - <ti>M</ti>
581 - <ti>MPROTECT</ti>
582 - <ti>
583 - Prevent the creation of new executable code to the process
584 - address space
585 - </ti>
586 -</tr>
587 -<tr>
588 - <ti>R</ti>
589 - <ti>RANDMMAP</ti>
590 - <ti>
591 - Randomize the stack base to prevent certain stack overflow
592 - attacks from being successful
593 - </ti>
594 -</tr>
595 -<tr>
596 - <ti>X</ti>
597 - <ti>RANDEXEC</ti>
598 - <ti>
599 - Randomize the address where the application maps to prevent
600 - certain attacks from being exploitable
601 - </ti>
602 -</tr>
603 -</table>
604 -
605 -<p>
606 -The default Linux kernel also supports certain capabilities, grouped in the
607 -so-called <e>POSIX.1e Capabilities</e>. You can find a listing of those
608 -capabilities in our <uri
609 -link="/proj/en/hardened/capabilities.xml">POSIX Capabilities</uri> document.
610 -</p>
611 -
612 -</body>
613 -</section>
614 -<section>
615 -<title>Using pspax</title>
616 -<body>
617 -
618 -<p>
619 -The <c>pspax</c> application, part of the <c>pax-utils</c> package, displays the
620 -run-time capabilities of all programs you have permission for. On Linux kernels
621 -with additional support for extended attributes (such as SELinux) those
622 -attributes are shown as well.
623 -</p>
624 -
625 -<p>
626 -When ran, <c>pspax</c> shows the following information:
627 -</p>
628 -
629 -<table>
630 -<tr>
631 - <th>Column</th>
632 - <th>Description</th>
633 -</tr>
634 -<tr>
635 - <ti>USER</ti>
636 - <ti>Owner of the process</ti>
637 -</tr>
638 -<tr>
639 - <ti>PID</ti>
640 - <ti>Process id</ti>
641 -</tr>
642 -<tr>
643 - <ti>PAX</ti>
644 - <ti>Run-time PaX flags (if applicable)</ti>
645 -</tr>
646 -<tr>
647 - <ti>MAPS</ti>
648 - <ti>Write/eXecute markings for the process map</ti>
649 -</tr>
650 -<tr>
651 - <ti>ELF_TYPE</ti>
652 - <ti>Process executable type: ET_DYN or ET_EXEC</ti>
653 -</tr>
654 -<tr>
655 - <ti>NAME</ti>
656 - <ti>Name of the process</ti>
657 -</tr>
658 -<tr>
659 - <ti>CAPS</ti>
660 - <ti>POSIX.1e capabilities (see note)</ti>
661 -</tr>
662 -<tr>
663 - <ti>ATTR</ti>
664 - <ti>Extended attributes (if applicable)</ti>
665 -</tr>
666 -</table>
667
668 <note>
669 -<c>pspax</c> only displays these capabilities when it is linked with
670 -the external capabilities library. This requires you to build <c>pax-utils</c>
671 -with -DWANT_SYSCAP.
672 +Due to the way in which <c>ldd</c> works you'll get all the libraries required
673 +at runtime, even those required by libraries you link to (and so on recursively)
674 +as a result <c>revdep-pax</c> will detect all dependencies in a single pass. If
675 +the behaviour of <c>ldd</c> changes so may change the behaviour of
676 +<c>revdep-pax</c>
677 </note>
678
679 <p>
680 -By default, <c>pspax</c> does not show any kernel processes. If you want those
681 -to be taken as well, use the <c>-a</c> switch.
682 -</p>
683 -
684 -</body>
685 -</section>
686 -</chapter>
687 -
688 -<chapter id="dumpelf">
689 -<title>Programming with ELF files</title>
690 -<section>
691 -<title>The dumpelf Utility</title>
692 -<body>
693 -
694 -<p>
695 -With the <c>dumpelf</c> utility you can convert a ELF file into human readable C
696 -code that defines a structure with the same image as the original ELF file.
697 +The <c>scanelf</c> application is part of the <c>app-misc/pax-utils</c> package.
698 +With this application you can print out information specific to the ELF
699 +structure of a binary. The following table sums up the various options.
700 </p>
701
702 -<pre caption="dumpelf example">
703 -$ <i>dumpelf /bin/hostname</i>
704 -#include &lt;elf.h&gt;
705 -
706 -<comment>/*
707 - * ELF dump of '/bin/hostname'
708 - * 10276 (0x2824) bytes
709 - */</comment>
710 -
711 -struct {
712 - Elf32_Ehdr ehdr;
713 - Elf32_Phdr phdrs[8];
714 - Elf32_Shdr shdrs[26];
715 -} dumpedelf_0 = {
716 -
717 -.ehdr = {
718 -<comment>(... Output stripped ...)</comment>
719 -</pre>
720 -
721 </body>
722 </section>
723 </chapter>
724 -</guide>
725 +</guide>
726 \ No newline at end of file