著者:後藤大地
前回の記事では、実装を複数の.c ファイルに分けて作成し、それらをコンパイルして.o ファイルに変更し、その.o ファイルを組み合わせてバイナリファイルを生成することを説明した。
.o ファイルはバイナリファイルのパーツのようになっており、これらを組み上げることで実装に動作するバイナリファイルを作ることができる。
記事本文掲載のシェルスクリプトマガジンvol.47は以下リンク先でご購入できます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
% ls /usr/lib | grep '\.a$' | head lib80211.a lib80211_p.a libBlocksRuntime.a libBlocksRuntime_p.a libalias.a libalias_cuseeme.a libalias_cuseeme_p.a libalias_dummy.a libalias_dummy_p.a libalias_ftp.a % cp /usr/lib/libalias.a ./ % file libalias.a libalias.a: current ar archive % ar -xv libalias.a x - alias_proxy.o x - alias_db.o x - alias.o x - alias_mod.o x - alias_util.o % tree . |-- alias.o |-- alias_db.o |-- alias_mod.o |-- alias_proxy.o |-- alias_util.o `-- libalias.a 0 directories, 6 files % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
% locate alias_mod.c /usr/src/sys/netinet/libalias/alias_mod.c % locate alias_util.c /usr/src/sys/netinet/libalias/alias_util.c % locate alias_db.c /usr/src/sys/netinet/libalias/alias_db.c % locate alias_proxy.c /usr/src/sys/netinet/libalias/alias_proxy.c % locate alias.c | grep netinet/libalias /usr/src/sys/netinet/libalias/alias.c % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
% tree . |-- include | `-- ore.h |-- lib `-- libore |-- Makefile |-- indent.c |-- ore.c |-- setmsg.c |-- usage.c `-- version.c 3 directories, 7 files % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
% cd libore % make cc -I. -I./../include/ -O2 -pipe -c indent.c -o indent.o cc -I. -I./../include/ -O2 -pipe -c ore.c -o ore.o cc -I. -I./../include/ -O2 -pipe -c setmsg.c -o setmsg.o cc -I. -I./../include/ -O2 -pipe -c usage.c -o usage.o cc -I. -I./../include/ -O2 -pipe -c version.c -o version.o ar -crv ./../lib/libore.a indent.o ore.o setmsg.o usage.o version.o a - indent.o a - ore.o a - setmsg.o a - usage.o a - version.o % cd .. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
% tree . |-- include | `-- ore.h |-- lib | `-- libore.a `-- libore |-- Makefile |-- indent.c |-- indent.o |-- ore.c |-- ore.o |-- setmsg.c |-- setmsg.o |-- usage.c |-- usage.o |-- version.c `-- version.o 3 directories, 13 files % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
% readelf -c libore.a Index of archive libore.a: (14 entries) Binary libore.a(indent.o) contains: _usage_msg _version_msg indent Binary libore.a(ore.o) contains: _usage_msg _version_msg Binary libore.a(setmsg.o) contains: _usage_msg _version_msg setmsg Binary libore.a(usage.o) contains: _usage_msg _version_msg usage Binary libore.a(version.o) contains: _usage_msg _version_msg version % |
1 2 3 4 5 6 7 8 9 10 11 12 |
% ar -xv libore.a x - indent.o x - ore.o x - setmsg.o x - usage.o x - version.o % ls indent.o libore.a ore.o setmsg.o usage.o v ersion.o % |
1 |
#include "ore.h" |
1 2 3 4 5 6 7 8 9 10 |
#include <stdio.h> #include "ore.h" void version(void) { fprintf(USAGE_OUT, ES_BOLD("バージョン:") " %s\n", _version_msg); } |
1 2 3 4 5 6 7 8 9 10 |
#include <stdio.h> #include "ore.h" void usage(void) { fprintf(USAGE_OUT, ES_BOLD("使い方:") "\n%s\n", indent(_usage_msg)); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include "ore.h" char * indent(char *t) { static char buf[BUFFER_SIZE]; char *p; int i = 0; p = t; buf[i++] = '\t'; for (; i < BUFFER_SIZE - 1; i++, p++) { buf[i] = *p; if ('\n' == *p) buf[++i] = '\t'; if ('\0' == *p) break; } if ('\0' != buf[i]) buf[i] = '\0'; return buf; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include <stdlib.h> #include <string.h> #include "ore.h" int setmsg(char *key, char *value) { if (0 == strcmp("usage", key)) { _usage_msg = calloc(1, BUFFER_SIZE * sizeof(char)); strncpy(_usage_msg, value, BUFFER_SIZE); _usage_msg[BUFFER_SIZE - 1] = '\0'; } else if (0 == strcmp("version", key)) { _version_msg = calloc(1, BUFFER_SIZE * sizeof(char)); strncpy(_version_msg, value, BUFFER_SIZE); _version_msg[BUFFER_SIZE - 1] = '\0'; } else return (-1); return 0; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#ifndef _ORE_H_ #define _ORE_H_ #define BUFFER_SIZE 4096 #define USAGE_OUT stderr #define VERSION_OUT stdout #define ESC_SEQ_NORM "\x1b[0m" #define ESC_SEQ_BOLD "\x1b[1m" #define ESC_SEQ_GRAY "\x1b[2m" #define ESC_SEQ_UBAR "\x1b[4m" #define ES_BOLD(X) ESC_SEQ_BOLD X ESC_SEQ_NORM #define ES_LIGHT(X) ESC_SEQ_GRAY X ESC_SEQ_NORM #define ES_UBAR(X) ESC_SEQ_UBAR X ESC_SEQ_NORM char *_usage_msg; char *_version_msg; char *indent(char *); int setmsg(char *, char *); void usage(void); void version(void); #endif |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
CFLAGS= -I. -I./../include/ -O2 -pipe LIBA= ./../lib/libore.a OBJS!= ls | grep '[.]c$$' 2> /dev/null | sed 's/.c$$/.o/g' .SUFFIXES: .o .c .c.o: cc ${CFLAGS} -c $< -o $@ all: ${OBJS} ar -crv ${LIBA} ${OBJS} clean: rm -f ${LIBA} ${OBJS} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
% tree . |-- bin |-- include | `-- ore.h |-- lib |-- libore | |-- Makefile | |-- indent.c | |-- ore.c | |-- setmsg.c | |-- usage.c | `-- version.c `-- src `-- bin `-- oreapp |-- Makefile `-- oreapp.c 7 directories, 9 files % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
% tree . |-- bin | `-- oreapp |-- include | `-- ore.h |-- lib | `-- libore.a |-- libore | |-- Makefile | |-- indent.c | |-- indent.o | |-- ore.c | |-- ore.o | |-- setmsg.c | |-- setmsg.o | |-- usage.c | |-- usage.o | |-- version.c | `-- version.o `-- src `-- bin `-- oreapp |-- Makefile |-- oreapp.c `-- oreapp.o 7 directories, 17 files % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sysexits.h> #include "ore.h" int main(int argc, char *argv[]) { setmsg("usage", "oreapp [-v] [-h] string..."); setmsg("version", "1.0"); int ch; while ((ch = getopt(argc, argv, "hv")) != -1) { switch (ch) { case 'v': version(); exit(EX_USAGE); break; case '?': case 'h': usage(); exit(EX_USAGE); break; default: usage(); exit(EX_USAGE); break; } } argc -= optind; argv += optind; for (int i = 0; i < argc; i++) printf("%06d %s\n", 1+i, argv[i]); return(EX_OK); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
BIN= ./../../../bin/oreapp LIBA= ./../../../lib/libore.a OBJS!= ls | grep '[.]c$$' 2> /dev/null | sed 's/.c$$/.o/g' CFLAGS= -I. -I./../../../include/ -O2 -pipe .SUFFIXES: .o .c .c.o: cc ${CFLAGS} -c $< -o $@ all: ${OBJS} cc ${CFLAGS} -o ${BIN} ${OBJS} -L./../../../lib/ -lore clean: rm -f ${BIN} ${OBJS} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
% cd libore/ % make cc -I. -I./../include/ -O2 -pipe -c indent.c -o indent.o cc -I. -I./../include/ -O2 -pipe -c ore.c -o ore.o cc -I. -I./../include/ -O2 -pipe -c setmsg.c -o setmsg.o cc -I. -I./../include/ -O2 -pipe -c usage.c -o usage.o cc -I. -I./../include/ -O2 -pipe -c version.c -o version.o ar -crv ./../lib/libore.a indent.o ore.o setmsg.o usage.o version.o a - indent.o a - ore.o a - setmsg.o a - usage.o a - version.o % cd ../src/bin/oreapp/ % make cc -I. -I./../../../include/ -O2 -pipe -c oreapp.c -o oreapp.o cc -I. -I./../../../include/ -O2 -pipe -o ./../../../bin/oreapp oreapp.o -L./../../../lib/ -lore % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
% ./oreapp -v バージョン: 1.0 % ./oreapp -h 使い方: oreapp [-v] [-h] string... % ./oreapp a b c d 000001 a 000002 b 000003 c 000004 d % |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
% readelf -a oreapp ELF Header: Magic: 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices x86-64 Version: 0x1 Entry point address: 0x4006e0 Start of program headers: 64 (bytes into file) Start of section headers: 4728 (bytes into file) Flags: 0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 8 Size of section headers: 64 (bytes) Number of section headers: 29 Section header string table index: 26 Elf file type is EXEC (Executable file) Entry point 0x4006e0 There are 8 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x0000000000000040 0x0000000000400040 0x0000000000400040 0x00000000000001c0 0x00000000000001c0 R E 0x8 INTERP 0x0000000000000200 0x0000000000400200 0x0000000000400200 0x0000000000000015 0x0000000000000015 R 0x1 [Requesting program interpreter: /libexec/ld-elf.so.1] LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000 0x0000000000000d6c 0x0000000000000d6c R E 0x200000 LOAD 0x0000000000000d70 0x0000000000600d70 0x0000000000600d70 0x0000000000000241 0x0000000000001278 RW 0x200000 DYNAMIC 0x0000000000000d98 0x0000000000600d98 0x0000000000600d98 0x00000000000001a0 0x00000000000001a0 RW 0x8 NOTE 0x0000000000000218 0x0000000000400218 0x0000000000400218 0x0000000000000030 0x0000000000000030 R 0x4 GNU_EH_FRAME 0x0000000000000c24 0x0000000000400c24 0x0000000000400c24 0x0000000000000044 0x0000000000000044 R 0x4 GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 RW 0x8 Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.tag .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame 03 .ctors .dtors .jcr .dynamic .got.plt .data .bss 04 .dynamic 05 .note.tag 06 .eh_frame_hdr 07 There are 29 section headers, starting at offset 0x1278: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] (null) NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .interp PROGBITS 0000000000400200 00000200 0000000000000015 0000000000000000 A 0 0 1 [ 2] .note.tag NOTE 0000000000400218 00000218 0000000000000030 0000000000000000 A 0 0 4 [ 3] .hash HASH 0000000000400248 00000248 0000000000000054 0000000000000004 A 5 0 8 [ 4] .gnu.hash GNU_HASH 00000000004002a0 000002a0 0000000000000038 0000000000000000 A 5 0 8 [ 5] .dynsym DYNSYM 00000000004002d8 000002d8 0000000000000180 0000000000000018 A 6 1 8 [ 6] .dynstr STRTAB 0000000000400458 00000458 0000000000000087 0000000000000000 A 0 0 1 [ 7] .gnu.version SUNW_versym 00000000004004e0 000004e0 0000000000000020 0000000000000002 A 5 0 2 [ 8] .gnu.version_r SUNW_verneed 0000000000400500 00000500 0000000000000020 0000000000000000 A 6 1 8 [ 9] .rela.dyn RELA 0000000000400520 00000520 0000000000000030 0000000000000018 A 5 0 8 [10] .rela.plt RELA 0000000000400550 00000550 00000000000000d8 0000000000000018 A 5 12 8 [11] .init PROGBITS 0000000000400628 00000628 0000000000000013 0000000000000000 AX 0 0 4 [12] .plt PROGBITS 000000000040063c 0000063c 00000000000000a0 0000000000000010 AX 0 0 4 [13] .text PROGBITS 00000000004006e0 000006e0 00000000000004c8 0000000000000000 AX 0 0 16 [14] .fini PROGBITS 0000000000400ba8 00000ba8 000000000000000e 0000000000000000 AX 0 0 4 [15] .rodata PROGBITS 0000000000400bb6 00000bb6 000000000000006d 0000000000000001 AMS 0 0 1 [16] .eh_frame_hdr PROGBITS 0000000000400c24 00000c24 0000000000000044 0000000000000000 A 0 0 4 [17] .eh_frame X86_64_UNWIND 0000000000400c68 00000c68 0000000000000104 0000000000000000 A 0 0 8 [18] .ctors PROGBITS 0000000000600d70 00000d70 0000000000000010 0000000000000000 WA 0 0 8 [19] .dtors PROGBITS 0000000000600d80 00000d80 0000000000000010 0000000000000000 WA 0 0 8 [20] .jcr PROGBITS 0000000000600d90 00000d90 0000000000000008 0000000000000000 WA 0 0 8 [21] .dynamic DYNAMIC 0000000000600d98 00000d98 00000000000001a0 0000000000000010 WA 6 0 8 [22] .got.plt PROGBITS 0000000000600f38 00000f38 0000000000000060 0000000000000008 WA 0 0 8 [23] .data PROGBITS 0000000000600f98 00000f98 0000000000000019 0000000000000000 WA 0 0 8 [24] .bss NOBITS 0000000000600fc0 00000fb1 0000000000001028 0000000000000000 WA 0 0 16 [25] .comment PROGBITS 0000000000000000 00000fb1 00000000000001e3 0000000000000001 MS 0 0 1 [26] .shstrtab STRTAB 0000000000000000 00001194 00000000000000e2 0000000000000000 0 0 1 [27] .symtab SYMTAB 0000000000000000 000019b8 0000000000000810 0000000000000018 28 58 8 [28] .strtab STRTAB 0000000000000000 000021c8 0000000000000363 0000000000000000 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) Dynamic section at offset 0xd98 contains 21 entries: Tag Type Name/Value 0x0000000000000001 NEEDED Shared library: [libc.so.7] 0x000000000000000c INIT 0x400628 0x000000000000000d FINI 0x400ba8 0x0000000000000004 HASH 0x400248 0x000000006ffffef5 GNU_HASH 0x4002a0 0x0000000000000005 STRTAB 0x400458 0x0000000000000006 SYMTAB 0x4002d8 0x000000000000000a STRSZ 135 (bytes) 0x000000000000000b SYMENT 24 (bytes) 0x0000000000000015 DEBUG 0x0 0x0000000000000003 PLTGOT 0x600f38 0x0000000000000002 PLTRELSZ 216 (bytes) 0x0000000000000014 PLTREL RELA 0x0000000000000017 JMPREL 0x400550 0x0000000000000007 RELA 0x400520 0x0000000000000008 RELASZ 48 (bytes) 0x0000000000000009 RELAENT 24 (bytes) 0x000000006ffffffe VERNEED 0x400500 0x000000006fffffff VERNEEDNUM 1 0x000000006ffffff0 VERSYM 0x4004e0 0x0000000000000000 NULL 0x0 Relocation section with addend (.rela.dyn): r_offset r_info r_type st_value st_name + r_addend 000000600fc0 000e00000005 R_X86_64_COPY 0000000000600fc0 optind + 0 000000600fc8 000f00000005 R_X86_64_COPY 0000000000600fc8 __stderrp + 0 Relocation section with addend (.rela.plt): r_offset r_info r_type st_value st_name + r_addend 000000600f50 000200000007 R_X86_64_JUMP_SLOT 0000000000000000 printf + 0 000000600f58 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 atexit + 0 000000600f60 000400000007 R_X86_64_JUMP_SLOT 0000000000000000 _init_tls + 0 000000600f68 000500000007 R_X86_64_JUMP_SLOT 0000000000000000 fprintf + 0 000000600f70 000600000007 R_X86_64_JUMP_SLOT 0000000000000000 getopt + 0 000000600f78 000700000007 R_X86_64_JUMP_SLOT 0000000000000000 calloc + 0 000000600f80 000800000007 R_X86_64_JUMP_SLOT 0000000000000000 strncpy + 0 000000600f88 000900000007 R_X86_64_JUMP_SLOT 0000000000000000 exit + 0 000000600f90 000a00000007 R_X86_64_JUMP_SLOT 0000000000000000 strcmp + 0 Symbol table (.dynsym) contains 16 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 2: 0000000000000000 188 FUNC GLOBAL DEFAULT UND printf@FBSD_1.0 (2) 3: 0000000000000000 71 FUNC GLOBAL DEFAULT UND atexit@FBSD_1.0 (2) 4: 0000000000000000 6 FUNC GLOBAL DEFAULT UND _init_tls@FBSD_1.0 (2) 5: 0000000000000000 239 FUNC GLOBAL DEFAULT UND fprintf@FBSD_1.0 (2) 6: 0000000000000000 617 FUNC GLOBAL DEFAULT UND getopt@FBSD_1.0 (2) 7: 0000000000000000 3171 FUNC GLOBAL DEFAULT UND calloc@FBSD_1.0 (2) 8: 0000000000000000 76 FUNC GLOBAL DEFAULT UND strncpy@FBSD_1.0 (2) 9: 0000000000000000 54 FUNC GLOBAL DEFAULT UND exit@FBSD_1.0 (2) 10: 0000000000000000 126 FUNC GLOBAL DEFAULT UND strcmp@FBSD_1.0 (2) 11: 0000000000601fd0 8 OBJECT GLOBAL DEFAULT 24 environ 12: 0000000000601fe8 0 NOTYPE GLOBAL DEFAULT ABS _end 13: 0000000000600f98 8 OBJECT GLOBAL DEFAULT 23 __progname 14: 0000000000600fc0 4 OBJECT GLOBAL DEFAULT 24 optind@FBSD_1.0 (2) 15: 0000000000600fc8 8 OBJECT GLOBAL DEFAULT 24 __stderrp@FBSD_1.0 (2) Symbol table (.symtab) contains 86 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000400200 0 SECTION LOCAL DEFAULT 1 2: 0000000000400218 0 SECTION LOCAL DEFAULT 2 3: 0000000000400248 0 SECTION LOCAL DEFAULT 3 4: 00000000004002a0 0 SECTION LOCAL DEFAULT 4 5: 00000000004002d8 0 SECTION LOCAL DEFAULT 5 6: 0000000000400458 0 SECTION LOCAL DEFAULT 6 7: 00000000004004e0 0 SECTION LOCAL DEFAULT 7 8: 0000000000400500 0 SECTION LOCAL DEFAULT 8 9: 0000000000400520 0 SECTION LOCAL DEFAULT 9 10: 0000000000400550 0 SECTION LOCAL DEFAULT 10 11: 0000000000400628 0 SECTION LOCAL DEFAULT 11 12: 000000000040063c 0 SECTION LOCAL DEFAULT 12 13: 00000000004006e0 0 SECTION LOCAL DEFAULT 13 14: 0000000000400ba8 0 SECTION LOCAL DEFAULT 14 15: 0000000000400bb6 0 SECTION LOCAL DEFAULT 15 16: 0000000000400c24 0 SECTION LOCAL DEFAULT 16 17: 0000000000400c68 0 SECTION LOCAL DEFAULT 17 18: 0000000000600d70 0 SECTION LOCAL DEFAULT 18 19: 0000000000600d80 0 SECTION LOCAL DEFAULT 19 20: 0000000000600d90 0 SECTION LOCAL DEFAULT 20 21: 0000000000600d98 0 SECTION LOCAL DEFAULT 21 22: 0000000000600f38 0 SECTION LOCAL DEFAULT 22 23: 0000000000600f98 0 SECTION LOCAL DEFAULT 23 24: 0000000000600fc0 0 SECTION LOCAL DEFAULT 24 25: 0000000000000000 0 SECTION LOCAL DEFAULT 25 26: 0000000000000000 0 FILE LOCAL DEFAULT ABS /usr/src/lib/csu/amd64/crt1.c 27: 0000000000400218 24 OBJECT LOCAL DEFAULT 2 abitag 28: 0000000000400230 24 OBJECT LOCAL DEFAULT 2 crt_noinit_tag 29: 0000000000400870 83 FUNC LOCAL DEFAULT 13 finalizer 30: 0000000000000000 0 FILE LOCAL DEFAULT ABS /usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c 31: 0000000000600d70 8 OBJECT LOCAL DEFAULT 18 __CTOR_LIST__ 32: 0000000000600d80 8 OBJECT LOCAL DEFAULT 19 __DTOR_LIST__ 33: 0000000000600d90 0 OBJECT LOCAL DEFAULT 20 __JCR_LIST__ 34: 00000000004008d0 53 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux 35: 0000000000600fb0 1 OBJECT LOCAL DEFAULT 23 __do_global_dtors_aux.completed 36: 0000000000600fa8 8 OBJECT LOCAL DEFAULT 23 __do_global_dtors_aux.p 37: 0000000000400910 34 FUNC LOCAL DEFAULT 13 frame_dummy 38: 0000000000000000 0 FILE LOCAL DEFAULT ABS /usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c 39: 0000000000600d78 8 OBJECT LOCAL DEFAULT 18 __CTOR_END__ 40: 0000000000600d88 8 OBJECT LOCAL DEFAULT 19 __DTOR_END__ 41: 0000000000400d68 4 OBJECT LOCAL DEFAULT 17 __FRAME_END__ 42: 0000000000600d90 8 OBJECT LOCAL DEFAULT 20 __JCR_END__ 43: 0000000000400b70 54 FUNC LOCAL DEFAULT 13 __do_global_ctors_aux 44: 0000000000000000 0 FILE LOCAL DEFAULT ABS oreapp.c 45: 0000000000000000 0 FILE LOCAL DEFAULT ABS setmsg.c 46: 0000000000000000 0 FILE LOCAL DEFAULT ABS usage.c 47: 0000000000000000 0 FILE LOCAL DEFAULT ABS version.c 48: 0000000000000000 0 FILE LOCAL DEFAULT ABS indent.c 49: 0000000000600fd0 4096 OBJECT LOCAL DEFAULT 24 indent.buf 50: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __preinit_array_start 51: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __fini_array_end 52: 0000000000600f38 0 OBJECT LOCAL HIDDEN 22 _GLOBAL_OFFSET_TABLE_ 53: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __preinit_array_end 54: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __fini_array_start 55: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __init_array_end 56: 0000000000600d6c 0 NOTYPE LOCAL HIDDEN 18 __init_array_start 57: 0000000000600d98 0 OBJECT LOCAL HIDDEN 21 _DYNAMIC 58: 0000000000600fc0 4 OBJECT GLOBAL DEFAULT 24 optind@@FBSD_1.0 59: 00000000004006e0 390 FUNC GLOBAL DEFAULT 13 _start 60: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 61: 0000000000600f98 8 OBJECT GLOBAL DEFAULT 23 __progname 62: 0000000000601fd8 8 OBJECT GLOBAL DEFAULT 24 _usage_msg 63: 0000000000400ba8 0 FUNC GLOBAL HIDDEN 14 _fini 64: 0000000000400a10 160 FUNC GLOBAL DEFAULT 13 setmsg 65: 0000000000000000 188 FUNC GLOBAL DEFAULT UND printf@@FBSD_1.0 66: 0000000000000000 71 FUNC GLOBAL DEFAULT UND atexit@@FBSD_1.0 67: 0000000000000000 6 FUNC GLOBAL DEFAULT UND _init_tls@@FBSD_1.0 68: 0000000000000000 239 FUNC GLOBAL DEFAULT UND fprintf@@FBSD_1.0 69: 0000000000000000 617 FUNC GLOBAL DEFAULT UND getopt@@FBSD_1.0 70: 0000000000400b10 90 FUNC GLOBAL DEFAULT 13 indent 71: 0000000000600fa0 8 OBJECT GLOBAL HIDDEN 23 __dso_handle 72: 0000000000601fe0 8 OBJECT GLOBAL DEFAULT 24 _version_msg 73: 0000000000400af0 31 FUNC GLOBAL DEFAULT 13 version 74: 0000000000000000 3171 FUNC GLOBAL DEFAULT UND calloc@@FBSD_1.0 75: 0000000000000000 76 FUNC GLOBAL DEFAULT UND strncpy@@FBSD_1.0 76: 0000000000600fb1 0 NOTYPE GLOBAL DEFAULT ABS __bss_start 77: 0000000000601fd0 8 OBJECT GLOBAL DEFAULT 24 environ 78: 0000000000601fe8 0 NOTYPE GLOBAL DEFAULT ABS _end 79: 0000000000400ab0 52 FUNC GLOBAL DEFAULT 13 usage 80: 0000000000000000 54 FUNC GLOBAL DEFAULT UND exit@@FBSD_1.0 81: 0000000000600fb1 0 NOTYPE GLOBAL DEFAULT ABS _edata 82: 0000000000600fc8 8 OBJECT GLOBAL DEFAULT 24 __stderrp@@FBSD_1.0 83: 0000000000000000 126 FUNC GLOBAL DEFAULT UND strcmp@@FBSD_1.0 84: 0000000000400940 196 FUNC GLOBAL DEFAULT 13 main 85: 0000000000400628 0 FUNC GLOBAL HIDDEN 11 _init Histogram for bucket list length (total of 3 buckets): Length Number % of total Coverage 0 0 ( 0.0%) 0.0% 1 0 ( 0.0%) 0.0% 2 1 ( 33.3%) 13.3% 3 0 ( 0.0%) 13.3% 4 0 ( 0.0%) 13.3% 5 0 ( 0.0%) 13.3% 6 1 ( 33.3%) 53.3% 7 1 ( 33.3%) 100.0% Histogram for bucket list length (total of 3 buckets): Length Number % of total Coverage 0 0 ( 0.0%) 0.0% 1 1 ( 33.3%) 25.0% 2 2 ( 66.7%) 125.0% Version symbol section (.gnu.version): 000: 0 *local* 0 *local* 2 FBSD_1.0 2 FBSD_1.0 004: 2 FBSD_1.0 2 FBSD_1.0 2 FBSD_1.0 2 FBSD_1.0 008: 2 FBSD_1.0 2 FBSD_1.0 2 FBSD_1.0 1 *global* 00c: 1 *global* 1 *global* 2 FBSD_1.0 2 FBSD_1.0 Version needed section (.gnu.version_r): 0x0000 vn_version: 1 vn_file: libc.so.7 vn_cnt: 1 0x0010 vna_name: FBSD_1.0 vna_flags: 0 vna_other: 2 % |