kallsyms.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. /* Generate assembler source containing symbol information
  2. *
  3. * Copyright 2002 by Kai Germaschewski
  4. *
  5. * This software may be used and distributed according to the terms
  6. * of the GNU General Public License, incorporated herein by reference.
  7. *
  8. * Usage: nm -n vmlinux | scripts/kallsyms [--all-symbols] > symbols.S
  9. *
  10. * ChangeLog:
  11. *
  12. * (25/Aug/2004) Paulo Marques <pmarques@grupopie.com>
  13. * Changed the compression method from stem compression to "table lookup"
  14. * compression
  15. *
  16. * Table compression uses all the unused char codes on the symbols and
  17. * maps these to the most used substrings (tokens). For instance, it might
  18. * map char code 0xF7 to represent "write_" and then in every symbol where
  19. * "write_" appears it can be replaced by 0xF7, saving 5 bytes.
  20. * The used codes themselves are also placed in the table so that the
  21. * decompresion can work without "special cases".
  22. * Applied to kernel symbols, this usually produces a compression ratio
  23. * of about 50%.
  24. *
  25. */
  26. #include <stdio.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. #include <ctype.h>
  30. /* maximum token length used. It doesn't pay to increase it a lot, because
  31. * very long substrings probably don't repeat themselves too often. */
  32. #define MAX_TOK_SIZE 11
  33. #define KSYM_NAME_LEN 127
  34. /* we use only a subset of the complete symbol table to gather the token count,
  35. * to speed up compression, at the expense of a little compression ratio */
  36. #define WORKING_SET 1024
  37. /* first find the best token only on the list of tokens that would profit more
  38. * than GOOD_BAD_THRESHOLD. Only if this list is empty go to the "bad" list.
  39. * Increasing this value will put less tokens on the "good" list, so the search
  40. * is faster. However, if the good list runs out of tokens, we must painfully
  41. * search the bad list. */
  42. #define GOOD_BAD_THRESHOLD 10
  43. /* token hash parameters */
  44. #define HASH_BITS 18
  45. #define HASH_TABLE_SIZE (1 << HASH_BITS)
  46. #define HASH_MASK (HASH_TABLE_SIZE - 1)
  47. #define HASH_BASE_OFFSET 2166136261U
  48. #define HASH_FOLD(a) ((a)&(HASH_MASK))
  49. /* flags to mark symbols */
  50. #define SYM_FLAG_VALID 1
  51. #define SYM_FLAG_SAMPLED 2
  52. struct sym_entry {
  53. unsigned long long addr;
  54. char type;
  55. unsigned char flags;
  56. unsigned char len;
  57. unsigned char *sym;
  58. };
  59. static struct sym_entry *table;
  60. static int size, cnt;
  61. static unsigned long long _stext, _etext, _sinittext, _einittext;
  62. static int all_symbols = 0;
  63. static char symbol_prefix_char = '\0';
  64. struct token {
  65. unsigned char data[MAX_TOK_SIZE];
  66. unsigned char len;
  67. /* profit: the number of bytes that could be saved by inserting this
  68. * token into the table */
  69. int profit;
  70. struct token *next; /* next token on the hash list */
  71. struct token *right; /* next token on the good/bad list */
  72. struct token *left; /* previous token on the good/bad list */
  73. struct token *smaller; /* token that is less one letter than this one */
  74. };
  75. struct token bad_head, good_head;
  76. struct token *hash_table[HASH_TABLE_SIZE];
  77. /* the table that holds the result of the compression */
  78. unsigned char best_table[256][MAX_TOK_SIZE+1];
  79. unsigned char best_table_len[256];
  80. static void
  81. usage(void)
  82. {
  83. fprintf(stderr, "Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] < in.map > out.S\n");
  84. exit(1);
  85. }
  86. /*
  87. * This ignores the intensely annoying "mapping symbols" found
  88. * in ARM ELF files: $a, $t and $d.
  89. */
  90. static inline int
  91. is_arm_mapping_symbol(const char *str)
  92. {
  93. return str[0] == '$' && strchr("atd", str[1])
  94. && (str[2] == '\0' || str[2] == '.');
  95. }
  96. static int
  97. read_symbol(FILE *in, struct sym_entry *s)
  98. {
  99. char str[500];
  100. char *sym;
  101. int rc;
  102. rc = fscanf(in, "%llx %c %499s\n", &s->addr, &s->type, str);
  103. if (rc != 3) {
  104. if (rc != EOF) {
  105. /* skip line */
  106. fgets(str, 500, in);
  107. }
  108. return -1;
  109. }
  110. sym = str;
  111. /* skip prefix char */
  112. if (symbol_prefix_char && str[0] == symbol_prefix_char)
  113. sym++;
  114. /* Ignore most absolute/undefined (?) symbols. */
  115. if (strcmp(sym, "_stext") == 0)
  116. _stext = s->addr;
  117. else if (strcmp(sym, "_etext") == 0)
  118. _etext = s->addr;
  119. else if (strcmp(sym, "_sinittext") == 0)
  120. _sinittext = s->addr;
  121. else if (strcmp(sym, "_einittext") == 0)
  122. _einittext = s->addr;
  123. else if (toupper(s->type) == 'A')
  124. {
  125. /* Keep these useful absolute symbols */
  126. if (strcmp(sym, "__kernel_syscall_via_break") &&
  127. strcmp(sym, "__kernel_syscall_via_epc") &&
  128. strcmp(sym, "__kernel_sigtramp") &&
  129. strcmp(sym, "__gp"))
  130. return -1;
  131. }
  132. else if (toupper(s->type) == 'U' ||
  133. is_arm_mapping_symbol(sym))
  134. return -1;
  135. /* include the type field in the symbol name, so that it gets
  136. * compressed together */
  137. s->len = strlen(str) + 1;
  138. s->sym = (char *) malloc(s->len + 1);
  139. strcpy(s->sym + 1, str);
  140. s->sym[0] = s->type;
  141. return 0;
  142. }
  143. static int
  144. symbol_valid(struct sym_entry *s)
  145. {
  146. /* Symbols which vary between passes. Passes 1 and 2 must have
  147. * identical symbol lists. The kallsyms_* symbols below are only added
  148. * after pass 1, they would be included in pass 2 when --all-symbols is
  149. * specified so exclude them to get a stable symbol list.
  150. */
  151. static char *special_symbols[] = {
  152. "kallsyms_addresses",
  153. "kallsyms_num_syms",
  154. "kallsyms_names",
  155. "kallsyms_markers",
  156. "kallsyms_token_table",
  157. "kallsyms_token_index",
  158. /* Exclude linker generated symbols which vary between passes */
  159. "_SDA_BASE_", /* ppc */
  160. "_SDA2_BASE_", /* ppc */
  161. NULL };
  162. int i;
  163. int offset = 1;
  164. /* skip prefix char */
  165. if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char)
  166. offset++;
  167. /* if --all-symbols is not specified, then symbols outside the text
  168. * and inittext sections are discarded */
  169. if (!all_symbols) {
  170. if ((s->addr < _stext || s->addr > _etext)
  171. && (s->addr < _sinittext || s->addr > _einittext))
  172. return 0;
  173. /* Corner case. Discard any symbols with the same value as
  174. * _etext or _einittext, they can move between pass 1 and 2
  175. * when the kallsyms data is added. If these symbols move then
  176. * they may get dropped in pass 2, which breaks the kallsyms
  177. * rules.
  178. */
  179. if ((s->addr == _etext && strcmp(s->sym + offset, "_etext")) ||
  180. (s->addr == _einittext && strcmp(s->sym + offset, "_einittext")))
  181. return 0;
  182. }
  183. /* Exclude symbols which vary between passes. */
  184. if (strstr(s->sym + offset, "_compiled."))
  185. return 0;
  186. for (i = 0; special_symbols[i]; i++)
  187. if( strcmp(s->sym + offset, special_symbols[i]) == 0 )
  188. return 0;
  189. return 1;
  190. }
  191. static void
  192. read_map(FILE *in)
  193. {
  194. while (!feof(in)) {
  195. if (cnt >= size) {
  196. size += 10000;
  197. table = realloc(table, sizeof(*table) * size);
  198. if (!table) {
  199. fprintf(stderr, "out of memory\n");
  200. exit (1);
  201. }
  202. }
  203. if (read_symbol(in, &table[cnt]) == 0)
  204. cnt++;
  205. }
  206. }
  207. static void output_label(char *label)
  208. {
  209. if (symbol_prefix_char)
  210. printf(".globl %c%s\n", symbol_prefix_char, label);
  211. else
  212. printf(".globl %s\n", label);
  213. printf("\tALGN\n");
  214. if (symbol_prefix_char)
  215. printf("%c%s:\n", symbol_prefix_char, label);
  216. else
  217. printf("%s:\n", label);
  218. }
  219. /* uncompress a compressed symbol. When this function is called, the best table
  220. * might still be compressed itself, so the function needs to be recursive */
  221. static int expand_symbol(unsigned char *data, int len, char *result)
  222. {
  223. int c, rlen, total=0;
  224. while (len) {
  225. c = *data;
  226. /* if the table holds a single char that is the same as the one
  227. * we are looking for, then end the search */
  228. if (best_table[c][0]==c && best_table_len[c]==1) {
  229. *result++ = c;
  230. total++;
  231. } else {
  232. /* if not, recurse and expand */
  233. rlen = expand_symbol(best_table[c], best_table_len[c], result);
  234. total += rlen;
  235. result += rlen;
  236. }
  237. data++;
  238. len--;
  239. }
  240. *result=0;
  241. return total;
  242. }
  243. static void
  244. write_src(void)
  245. {
  246. int i, k, off, valid;
  247. unsigned int best_idx[256];
  248. unsigned int *markers;
  249. char buf[KSYM_NAME_LEN+1];
  250. printf("#include <asm/types.h>\n");
  251. printf("#if BITS_PER_LONG == 64\n");
  252. printf("#define PTR .quad\n");
  253. printf("#define ALGN .align 8\n");
  254. printf("#else\n");
  255. printf("#define PTR .long\n");
  256. printf("#define ALGN .align 4\n");
  257. printf("#endif\n");
  258. printf(".data\n");
  259. output_label("kallsyms_addresses");
  260. valid = 0;
  261. for (i = 0; i < cnt; i++) {
  262. if (table[i].flags & SYM_FLAG_VALID) {
  263. printf("\tPTR\t%#llx\n", table[i].addr);
  264. valid++;
  265. }
  266. }
  267. printf("\n");
  268. output_label("kallsyms_num_syms");
  269. printf("\tPTR\t%d\n", valid);
  270. printf("\n");
  271. /* table of offset markers, that give the offset in the compressed stream
  272. * every 256 symbols */
  273. markers = (unsigned int *) malloc(sizeof(unsigned int)*((valid + 255) / 256));
  274. output_label("kallsyms_names");
  275. valid = 0;
  276. off = 0;
  277. for (i = 0; i < cnt; i++) {
  278. if (!table[i].flags & SYM_FLAG_VALID)
  279. continue;
  280. if ((valid & 0xFF) == 0)
  281. markers[valid >> 8] = off;
  282. printf("\t.byte 0x%02x", table[i].len);
  283. for (k = 0; k < table[i].len; k++)
  284. printf(", 0x%02x", table[i].sym[k]);
  285. printf("\n");
  286. off += table[i].len + 1;
  287. valid++;
  288. }
  289. printf("\n");
  290. output_label("kallsyms_markers");
  291. for (i = 0; i < ((valid + 255) >> 8); i++)
  292. printf("\tPTR\t%d\n", markers[i]);
  293. printf("\n");
  294. free(markers);
  295. output_label("kallsyms_token_table");
  296. off = 0;
  297. for (i = 0; i < 256; i++) {
  298. best_idx[i] = off;
  299. expand_symbol(best_table[i],best_table_len[i],buf);
  300. printf("\t.asciz\t\"%s\"\n", buf);
  301. off += strlen(buf) + 1;
  302. }
  303. printf("\n");
  304. output_label("kallsyms_token_index");
  305. for (i = 0; i < 256; i++)
  306. printf("\t.short\t%d\n", best_idx[i]);
  307. printf("\n");
  308. }
  309. /* table lookup compression functions */
  310. static inline unsigned int rehash_token(unsigned int hash, unsigned char data)
  311. {
  312. return ((hash * 16777619) ^ data);
  313. }
  314. static unsigned int hash_token(unsigned char *data, int len)
  315. {
  316. unsigned int hash=HASH_BASE_OFFSET;
  317. int i;
  318. for (i = 0; i < len; i++)
  319. hash = rehash_token(hash, data[i]);
  320. return HASH_FOLD(hash);
  321. }
  322. /* find a token given its data and hash value */
  323. static struct token *find_token_hash(unsigned char *data, int len, unsigned int hash)
  324. {
  325. struct token *ptr;
  326. ptr = hash_table[hash];
  327. while (ptr) {
  328. if ((ptr->len == len) && (memcmp(ptr->data, data, len) == 0))
  329. return ptr;
  330. ptr=ptr->next;
  331. }
  332. return NULL;
  333. }
  334. static inline void insert_token_in_group(struct token *head, struct token *ptr)
  335. {
  336. ptr->right = head->right;
  337. ptr->right->left = ptr;
  338. head->right = ptr;
  339. ptr->left = head;
  340. }
  341. static inline void remove_token_from_group(struct token *ptr)
  342. {
  343. ptr->left->right = ptr->right;
  344. ptr->right->left = ptr->left;
  345. }
  346. /* build the counts for all the tokens that start with "data", and have lenghts
  347. * from 2 to "len" */
  348. static void learn_token(unsigned char *data, int len)
  349. {
  350. struct token *ptr,*last_ptr;
  351. int i, newprofit;
  352. unsigned int hash = HASH_BASE_OFFSET;
  353. unsigned int hashes[MAX_TOK_SIZE + 1];
  354. if (len > MAX_TOK_SIZE)
  355. len = MAX_TOK_SIZE;
  356. /* calculate and store the hash values for all the sub-tokens */
  357. hash = rehash_token(hash, data[0]);
  358. for (i = 2; i <= len; i++) {
  359. hash = rehash_token(hash, data[i-1]);
  360. hashes[i] = HASH_FOLD(hash);
  361. }
  362. last_ptr = NULL;
  363. ptr = NULL;
  364. for (i = len; i >= 2; i--) {
  365. hash = hashes[i];
  366. if (!ptr) ptr = find_token_hash(data, i, hash);
  367. if (!ptr) {
  368. /* create a new token entry */
  369. ptr = (struct token *) malloc(sizeof(*ptr));
  370. memcpy(ptr->data, data, i);
  371. ptr->len = i;
  372. /* when we create an entry, it's profit is 0 because
  373. * we also take into account the size of the token on
  374. * the compressed table. We then subtract GOOD_BAD_THRESHOLD
  375. * so that the test to see if this token belongs to
  376. * the good or bad list, is a comparison to zero */
  377. ptr->profit = -GOOD_BAD_THRESHOLD;
  378. ptr->next = hash_table[hash];
  379. hash_table[hash] = ptr;
  380. insert_token_in_group(&bad_head, ptr);
  381. ptr->smaller = NULL;
  382. } else {
  383. newprofit = ptr->profit + (ptr->len - 1);
  384. /* check to see if this token needs to be moved to a
  385. * different list */
  386. if((ptr->profit < 0) && (newprofit >= 0)) {
  387. remove_token_from_group(ptr);
  388. insert_token_in_group(&good_head,ptr);
  389. }
  390. ptr->profit = newprofit;
  391. }
  392. if (last_ptr) last_ptr->smaller = ptr;
  393. last_ptr = ptr;
  394. ptr = ptr->smaller;
  395. }
  396. }
  397. /* decrease the counts for all the tokens that start with "data", and have lenghts
  398. * from 2 to "len". This function is much simpler than learn_token because we have
  399. * more guarantees (tho tokens exist, the ->smaller pointer is set, etc.)
  400. * The two separate functions exist only because of compression performance */
  401. static void forget_token(unsigned char *data, int len)
  402. {
  403. struct token *ptr;
  404. int i, newprofit;
  405. unsigned int hash=0;
  406. if (len > MAX_TOK_SIZE) len = MAX_TOK_SIZE;
  407. hash = hash_token(data, len);
  408. ptr = find_token_hash(data, len, hash);
  409. for (i = len; i >= 2; i--) {
  410. newprofit = ptr->profit - (ptr->len - 1);
  411. if ((ptr->profit >= 0) && (newprofit < 0)) {
  412. remove_token_from_group(ptr);
  413. insert_token_in_group(&bad_head, ptr);
  414. }
  415. ptr->profit=newprofit;
  416. ptr=ptr->smaller;
  417. }
  418. }
  419. /* count all the possible tokens in a symbol */
  420. static void learn_symbol(unsigned char *symbol, int len)
  421. {
  422. int i;
  423. for (i = 0; i < len - 1; i++)
  424. learn_token(symbol + i, len - i);
  425. }
  426. /* decrease the count for all the possible tokens in a symbol */
  427. static void forget_symbol(unsigned char *symbol, int len)
  428. {
  429. int i;
  430. for (i = 0; i < len - 1; i++)
  431. forget_token(symbol + i, len - i);
  432. }
  433. /* set all the symbol flags and do the initial token count */
  434. static void build_initial_tok_table(void)
  435. {
  436. int i, use_it, valid;
  437. valid = 0;
  438. for (i = 0; i < cnt; i++) {
  439. table[i].flags = 0;
  440. if ( symbol_valid(&table[i]) ) {
  441. table[i].flags |= SYM_FLAG_VALID;
  442. valid++;
  443. }
  444. }
  445. use_it = 0;
  446. for (i = 0; i < cnt; i++) {
  447. /* subsample the available symbols. This method is almost like
  448. * a Bresenham's algorithm to get uniformly distributed samples
  449. * across the symbol table */
  450. if (table[i].flags & SYM_FLAG_VALID) {
  451. use_it += WORKING_SET;
  452. if (use_it >= valid) {
  453. table[i].flags |= SYM_FLAG_SAMPLED;
  454. use_it -= valid;
  455. }
  456. }
  457. if (table[i].flags & SYM_FLAG_SAMPLED)
  458. learn_symbol(table[i].sym, table[i].len);
  459. }
  460. }
  461. /* replace a given token in all the valid symbols. Use the sampled symbols
  462. * to update the counts */
  463. static void compress_symbols(unsigned char *str, int tlen, int idx)
  464. {
  465. int i, len, learn, size;
  466. unsigned char *p;
  467. for (i = 0; i < cnt; i++) {
  468. if (!(table[i].flags & SYM_FLAG_VALID)) continue;
  469. len = table[i].len;
  470. learn = 0;
  471. p = table[i].sym;
  472. do {
  473. /* find the token on the symbol */
  474. p = (unsigned char *) strstr((char *) p, (char *) str);
  475. if (!p) break;
  476. if (!learn) {
  477. /* if this symbol was used to count, decrease it */
  478. if (table[i].flags & SYM_FLAG_SAMPLED)
  479. forget_symbol(table[i].sym, len);
  480. learn = 1;
  481. }
  482. *p = idx;
  483. size = (len - (p - table[i].sym)) - tlen + 1;
  484. memmove(p + 1, p + tlen, size);
  485. p++;
  486. len -= tlen - 1;
  487. } while (size >= tlen);
  488. if(learn) {
  489. table[i].len = len;
  490. /* if this symbol was used to count, learn it again */
  491. if(table[i].flags & SYM_FLAG_SAMPLED)
  492. learn_symbol(table[i].sym, len);
  493. }
  494. }
  495. }
  496. /* search the token with the maximum profit */
  497. static struct token *find_best_token(void)
  498. {
  499. struct token *ptr,*best,*head;
  500. int bestprofit;
  501. bestprofit=-10000;
  502. /* failsafe: if the "good" list is empty search from the "bad" list */
  503. if(good_head.right == &good_head) head = &bad_head;
  504. else head = &good_head;
  505. ptr = head->right;
  506. best = NULL;
  507. while (ptr != head) {
  508. if (ptr->profit > bestprofit) {
  509. bestprofit = ptr->profit;
  510. best = ptr;
  511. }
  512. ptr = ptr->right;
  513. }
  514. return best;
  515. }
  516. /* this is the core of the algorithm: calculate the "best" table */
  517. static void optimize_result(void)
  518. {
  519. struct token *best;
  520. int i;
  521. /* using the '\0' symbol last allows compress_symbols to use standard
  522. * fast string functions */
  523. for (i = 255; i >= 0; i--) {
  524. /* if this table slot is empty (it is not used by an actual
  525. * original char code */
  526. if (!best_table_len[i]) {
  527. /* find the token with the breates profit value */
  528. best = find_best_token();
  529. /* place it in the "best" table */
  530. best_table_len[i] = best->len;
  531. memcpy(best_table[i], best->data, best_table_len[i]);
  532. /* zero terminate the token so that we can use strstr
  533. in compress_symbols */
  534. best_table[i][best_table_len[i]]='\0';
  535. /* replace this token in all the valid symbols */
  536. compress_symbols(best_table[i], best_table_len[i], i);
  537. }
  538. }
  539. }
  540. /* start by placing the symbols that are actually used on the table */
  541. static void insert_real_symbols_in_table(void)
  542. {
  543. int i, j, c;
  544. memset(best_table, 0, sizeof(best_table));
  545. memset(best_table_len, 0, sizeof(best_table_len));
  546. for (i = 0; i < cnt; i++) {
  547. if (table[i].flags & SYM_FLAG_VALID) {
  548. for (j = 0; j < table[i].len; j++) {
  549. c = table[i].sym[j];
  550. best_table[c][0]=c;
  551. best_table_len[c]=1;
  552. }
  553. }
  554. }
  555. }
  556. static void optimize_token_table(void)
  557. {
  558. memset(hash_table, 0, sizeof(hash_table));
  559. good_head.left = &good_head;
  560. good_head.right = &good_head;
  561. bad_head.left = &bad_head;
  562. bad_head.right = &bad_head;
  563. build_initial_tok_table();
  564. insert_real_symbols_in_table();
  565. /* When valid symbol is not registered, exit to error */
  566. if (good_head.left == good_head.right &&
  567. bad_head.left == bad_head.right) {
  568. fprintf(stderr, "No valid symbol.\n");
  569. exit(1);
  570. }
  571. optimize_result();
  572. }
  573. int
  574. main(int argc, char **argv)
  575. {
  576. if (argc >= 2) {
  577. int i;
  578. for (i = 1; i < argc; i++) {
  579. if(strcmp(argv[i], "--all-symbols") == 0)
  580. all_symbols = 1;
  581. else if (strncmp(argv[i], "--symbol-prefix=", 16) == 0) {
  582. char *p = &argv[i][16];
  583. /* skip quote */
  584. if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\''))
  585. p++;
  586. symbol_prefix_char = *p;
  587. } else
  588. usage();
  589. }
  590. } else if (argc != 1)
  591. usage();
  592. read_map(stdin);
  593. optimize_token_table();
  594. write_src();
  595. return 0;
  596. }