avr-binutils-size-2.33.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. --- binutils/size.c 2021-07-08 07:37:19.000000000 -0400
  2. +++ binutils/size.c 2021-12-26 12:29:54.429154946 -0500
  3. @@ -34,8 +34,8 @@
  4. #include "getopt.h"
  5. #include "bucomm.h"
  6. -#ifndef BSD_DEFAULT
  7. -#define BSD_DEFAULT 1
  8. +#ifndef AVR_DEFAULT
  9. +#define AVR_DEFAULT 1
  10. #endif
  11. /* Program options. */
  12. @@ -51,10 +51,13 @@
  13. {
  14. FORMAT_BERKLEY,
  15. FORMAT_SYSV,
  16. - FORMAT_GNU
  17. + FORMAT_GNU,
  18. + FORMAT_AVR
  19. };
  20. static enum output_format selected_output_format =
  21. -#if BSD_DEFAULT
  22. +#if AVR_DEFAULT
  23. + FORMAT_AVR
  24. +#elif BSD_DEFAULT
  25. FORMAT_BERKLEY
  26. #else
  27. FORMAT_SYSV
  28. @@ -73,6 +76,246 @@
  29. /* Program exit status. */
  30. static int return_code = 0;
  31. +
  32. +
  33. +/* AVR Size specific stuff */
  34. +
  35. +#define AVR64 64UL
  36. +#define AVR128 128UL
  37. +#define AVR256 256UL
  38. +#define AVR512 512UL
  39. +#define AVR1K 1024UL
  40. +#define AVR2K 2048UL
  41. +#define AVR4K 4096UL
  42. +#define AVR8K 8192UL
  43. +#define AVR16K 16384UL
  44. +#define AVR20K 20480UL
  45. +#define AVR24K 24576UL
  46. +#define AVR32K 32768UL
  47. +#define AVR36K 36864UL
  48. +#define AVR40K 40960UL
  49. +#define AVR64K 65536UL
  50. +#define AVR68K 69632UL
  51. +#define AVR128K 131072UL
  52. +#define AVR136K 139264UL
  53. +#define AVR200K 204800UL
  54. +#define AVR256K 262144UL
  55. +#define AVR264K 270336UL
  56. +
  57. +typedef struct
  58. +{
  59. + char *name;
  60. + long flash;
  61. + long ram;
  62. + long eeprom;
  63. +} avr_device_t;
  64. +
  65. +avr_device_t avr[] =
  66. +{
  67. + {"atxmega256a3", AVR264K, AVR16K, AVR4K},
  68. + {"atxmega256a3b", AVR264K, AVR16K, AVR4K},
  69. + {"atxmega256d3", AVR264K, AVR16K, AVR4K},
  70. +
  71. + {"atmega2560", AVR256K, AVR8K, AVR4K},
  72. + {"atmega2561", AVR256K, AVR8K, AVR4K},
  73. +
  74. + {"atxmega192a3", AVR200K, AVR16K, AVR2K},
  75. + {"atxmega192d3", AVR200K, AVR16K, AVR2K},
  76. +
  77. + {"atxmega128a1", AVR136K, AVR8K, AVR2K},
  78. + {"atxmega128a1u", AVR136K, AVR8K, AVR2K},
  79. + {"atxmega128a3", AVR136K, AVR8K, AVR2K},
  80. + {"atxmega128d3", AVR136K, AVR8K, AVR2K},
  81. +
  82. + {"at43usb320", AVR128K, 608UL, 0UL},
  83. + {"at90can128", AVR128K, AVR4K, AVR4K},
  84. + {"at90usb1286", AVR128K, AVR8K, AVR4K},
  85. + {"at90usb1287", AVR128K, AVR8K, AVR4K},
  86. + {"atmega128", AVR128K, AVR4K, AVR4K},
  87. + {"atmega1280", AVR128K, AVR8K, AVR4K},
  88. + {"atmega1281", AVR128K, AVR8K, AVR4K},
  89. + {"atmega1284p", AVR128K, AVR16K, AVR4K},
  90. + {"atmega128rfa1", AVR128K, AVR16K, AVR4K},
  91. + {"atmega103", AVR128K, 4000UL, AVR4K},
  92. +
  93. + {"atxmega64a1", AVR68K, AVR4K, AVR2K},
  94. + {"atxmega64a1u", AVR68K, AVR4K, AVR2K},
  95. + {"atxmega64a3", AVR68K, AVR4K, AVR2K},
  96. + {"atxmega64d3", AVR68K, AVR4K, AVR2K},
  97. +
  98. + {"at90can64", AVR64K, AVR4K, AVR2K},
  99. + {"at90scr100", AVR64K, AVR4K, AVR2K},
  100. + {"at90usb646", AVR64K, AVR4K, AVR2K},
  101. + {"at90usb647", AVR64K, AVR4K, AVR2K},
  102. + {"atmega64", AVR64K, AVR4K, AVR2K},
  103. + {"atmega640", AVR64K, AVR8K, AVR4K},
  104. + {"atmega644", AVR64K, AVR4K, AVR2K},
  105. + {"atmega644a", AVR64K, AVR4K, AVR2K},
  106. + {"atmega644p", AVR64K, AVR4K, AVR2K},
  107. + {"atmega644pa", AVR64K, AVR4K, AVR2K},
  108. + {"atmega645", AVR64K, AVR4K, AVR2K},
  109. + {"atmega645a", AVR64K, AVR4K, AVR2K},
  110. + {"atmega645p", AVR64K, AVR4K, AVR2K},
  111. + {"atmega6450", AVR64K, AVR4K, AVR2K},
  112. + {"atmega6450a", AVR64K, AVR4K, AVR2K},
  113. + {"atmega6450p", AVR64K, AVR4K, AVR2K},
  114. + {"atmega649", AVR64K, AVR4K, AVR2K},
  115. + {"atmega649a", AVR64K, AVR4K, AVR2K},
  116. + {"atmega649p", AVR64K, AVR4K, AVR2K},
  117. + {"atmega6490", AVR64K, AVR4K, AVR2K},
  118. + {"atmega6490a", AVR64K, AVR4K, AVR2K},
  119. + {"atmega6490p", AVR64K, AVR4K, AVR2K},
  120. + {"atmega64c1", AVR64K, AVR4K, AVR2K},
  121. + {"atmega64hve", AVR64K, AVR4K, AVR1K},
  122. + {"atmega64m1", AVR64K, AVR4K, AVR2K},
  123. + {"m3000", AVR64K, AVR4K, 0UL},
  124. +
  125. + {"atmega406", AVR40K, AVR2K, AVR512},
  126. +
  127. + {"atxmega32a4", AVR36K, AVR4K, AVR1K},
  128. + {"atxmega32d4", AVR36K, AVR4K, AVR1K},
  129. +
  130. + {"at90can32", AVR32K, AVR2K, AVR1K},
  131. + {"at94k", AVR32K, AVR4K, 0UL},
  132. + {"atmega32", AVR32K, AVR2K, AVR1K},
  133. + {"atmega323", AVR32K, AVR2K, AVR1K},
  134. + {"atmega324a", AVR32K, AVR2K, AVR1K},
  135. + {"atmega324p", AVR32K, AVR2K, AVR1K},
  136. + {"atmega324pa", AVR32K, AVR2K, AVR1K},
  137. + {"atmega325", AVR32K, AVR2K, AVR1K},
  138. + {"atmega325a", AVR32K, AVR2K, AVR1K},
  139. + {"atmega325p", AVR32K, AVR2K, AVR1K},
  140. + {"atmega3250", AVR32K, AVR2K, AVR1K},
  141. + {"atmega3250a", AVR32K, AVR2K, AVR1K},
  142. + {"atmega3250p", AVR32K, AVR2K, AVR1K},
  143. + {"atmega328", AVR32K, AVR2K, AVR1K},
  144. + {"atmega328p", AVR32K, AVR2K, AVR1K},
  145. + {"atmega329", AVR32K, AVR2K, AVR1K},
  146. + {"atmega329a", AVR32K, AVR2K, AVR1K},
  147. + {"atmega329p", AVR32K, AVR2K, AVR1K},
  148. + {"atmega329pa", AVR32K, AVR2K, AVR1K},
  149. + {"atmega3290", AVR32K, AVR2K, AVR1K},
  150. + {"atmega3290a", AVR32K, AVR2K, AVR1K},
  151. + {"atmega3290p", AVR32K, AVR2K, AVR1K},
  152. + {"atmega32hvb", AVR32K, AVR2K, AVR1K},
  153. + {"atmega32c1", AVR32K, AVR2K, AVR1K},
  154. + {"atmega32hvb", AVR32K, AVR2K, AVR1K},
  155. + {"atmega32m1", AVR32K, AVR2K, AVR1K},
  156. + {"atmega32u2", AVR32K, AVR1K, AVR1K},
  157. + {"atmega32u4", AVR32K, 2560UL, AVR1K},
  158. + {"atmega32u6", AVR32K, 2560UL, AVR1K},
  159. +
  160. + {"at43usb355", AVR24K, 1120UL, 0UL},
  161. +
  162. + {"atxmega16a4", AVR20K, AVR2K, AVR1K},
  163. + {"atxmega16d4", AVR20K, AVR2K, AVR1K},
  164. +
  165. + {"at76c711", AVR16K, AVR2K, 0UL},
  166. + {"at90pwm216", AVR16K, AVR1K, AVR512},
  167. + {"at90pwm316", AVR16K, AVR1K, AVR512},
  168. + {"at90usb162", AVR16K, AVR512, AVR512},
  169. + {"atmega16", AVR16K, AVR1K, AVR512},
  170. + {"atmega16a", AVR16K, AVR1K, AVR512},
  171. + {"atmega161", AVR16K, AVR1K, AVR512},
  172. + {"atmega162", AVR16K, AVR1K, AVR512},
  173. + {"atmega163", AVR16K, AVR1K, AVR512},
  174. + {"atmega164", AVR16K, AVR1K, AVR512},
  175. + {"atmega164a", AVR16K, AVR1K, AVR512},
  176. + {"atmega164p", AVR16K, AVR1K, AVR512},
  177. + {"atmega165a", AVR16K, AVR1K, AVR512},
  178. + {"atmega165", AVR16K, AVR1K, AVR512},
  179. + {"atmega165p", AVR16K, AVR1K, AVR512},
  180. + {"atmega168", AVR16K, AVR1K, AVR512},
  181. + {"atmega168a", AVR16K, AVR1K, AVR512},
  182. + {"atmega168p", AVR16K, AVR1K, AVR512},
  183. + {"atmega169", AVR16K, AVR1K, AVR512},
  184. + {"atmega169a", AVR16K, AVR1K, AVR512},
  185. + {"atmega169p", AVR16K, AVR1K, AVR512},
  186. + {"atmega169pa", AVR16K, AVR1K, AVR512},
  187. + {"atmega16hva", AVR16K, 768UL, AVR256},
  188. + {"atmega16hva2", AVR16K, AVR1K, AVR256},
  189. + {"atmega16hvb", AVR16K, AVR1K, AVR512},
  190. + {"atmega16m1", AVR16K, AVR1K, AVR512},
  191. + {"atmega16u2", AVR16K, AVR512, AVR512},
  192. + {"atmega16u4", AVR16K, 1280UL, AVR512},
  193. + {"attiny167", AVR16K, AVR512, AVR512},
  194. +
  195. + {"at90c8534", AVR8K, 352UL, AVR512},
  196. + {"at90pwm1", AVR8K, AVR512, AVR512},
  197. + {"at90pwm2", AVR8K, AVR512, AVR512},
  198. + {"at90pwm2b", AVR8K, AVR512, AVR512},
  199. + {"at90pwm3", AVR8K, AVR512, AVR512},
  200. + {"at90pwm3b", AVR8K, AVR512, AVR512},
  201. + {"at90pwm81", AVR8K, AVR256, AVR512},
  202. + {"at90s8515", AVR8K, AVR512, AVR512},
  203. + {"at90s8535", AVR8K, AVR512, AVR512},
  204. + {"at90usb82", AVR8K, AVR512, AVR512},
  205. + {"ata6289", AVR8K, AVR512, 320UL},
  206. + {"atmega8", AVR8K, AVR1K, AVR512},
  207. + {"atmega8515", AVR8K, AVR512, AVR512},
  208. + {"atmega8535", AVR8K, AVR512, AVR512},
  209. + {"atmega88", AVR8K, AVR1K, AVR512},
  210. + {"atmega88a", AVR8K, AVR1K, AVR512},
  211. + {"atmega88p", AVR8K, AVR1K, AVR512},
  212. + {"atmega88pa", AVR8K, AVR1K, AVR512},
  213. + {"atmega8hva", AVR8K, 768UL, AVR256},
  214. + {"atmega8u2", AVR8K, AVR512, AVR512},
  215. + {"attiny84", AVR8K, AVR512, AVR512},
  216. + {"attiny84a", AVR8K, AVR512, AVR512},
  217. + {"attiny85", AVR8K, AVR512, AVR512},
  218. + {"attiny861", AVR8K, AVR512, AVR512},
  219. + {"attiny861a", AVR8K, AVR512, AVR512},
  220. + {"attiny87", AVR8K, AVR512, AVR512},
  221. + {"attiny88", AVR8K, AVR512, AVR64},
  222. +
  223. + {"at90s4414", AVR4K, 352UL, AVR256},
  224. + {"at90s4433", AVR4K, AVR128, AVR256},
  225. + {"at90s4434", AVR4K, 352UL, AVR256},
  226. + {"atmega48", AVR4K, AVR512, AVR256},
  227. + {"atmega48a", AVR4K, AVR512, AVR256},
  228. + {"atmega48p", AVR4K, AVR512, AVR256},
  229. + {"attiny4313", AVR4K, AVR256, AVR256},
  230. + {"attiny43u", AVR4K, AVR256, AVR64},
  231. + {"attiny44", AVR4K, AVR256, AVR256},
  232. + {"attiny44a", AVR4K, AVR256, AVR256},
  233. + {"attiny45", AVR4K, AVR256, AVR256},
  234. + {"attiny461", AVR4K, AVR256, AVR256},
  235. + {"attiny461a", AVR4K, AVR256, AVR256},
  236. + {"attiny48", AVR4K, AVR256, AVR64},
  237. +
  238. + {"at86rf401", AVR2K, 224UL, AVR128},
  239. + {"at90s2313", AVR2K, AVR128, AVR128},
  240. + {"at90s2323", AVR2K, AVR128, AVR128},
  241. + {"at90s2333", AVR2K, 224UL, AVR128},
  242. + {"at90s2343", AVR2K, AVR128, AVR128},
  243. + {"attiny20", AVR2K, AVR128, 0UL},
  244. + {"attiny22", AVR2K, 224UL, AVR128},
  245. + {"attiny2313", AVR2K, AVR128, AVR128},
  246. + {"attiny2313a", AVR2K, AVR128, AVR128},
  247. + {"attiny24", AVR2K, AVR128, AVR128},
  248. + {"attiny24a", AVR2K, AVR128, AVR128},
  249. + {"attiny25", AVR2K, AVR128, AVR128},
  250. + {"attiny26", AVR2K, AVR128, AVR128},
  251. + {"attiny261", AVR2K, AVR128, AVR128},
  252. + {"attiny261a", AVR2K, AVR128, AVR128},
  253. + {"attiny28", AVR2K, 0UL, 0UL},
  254. + {"attiny40", AVR2K, AVR256, 0UL},
  255. +
  256. + {"at90s1200", AVR1K, 0UL, AVR64},
  257. + {"attiny9", AVR1K, 32UL, 0UL},
  258. + {"attiny10", AVR1K, 32UL, 0UL},
  259. + {"attiny11", AVR1K, 0UL, AVR64},
  260. + {"attiny12", AVR1K, 0UL, AVR64},
  261. + {"attiny13", AVR1K, AVR64, AVR64},
  262. + {"attiny13a", AVR1K, AVR64, AVR64},
  263. + {"attiny15", AVR1K, 0UL, AVR64},
  264. +
  265. + {"attiny4", AVR512, 32UL, 0UL},
  266. + {"attiny5", AVR512, 32UL, 0UL},
  267. +};
  268. +
  269. +static char *avrmcu = NULL;
  270. +
  271. static char *target = NULL;
  272. @@ -89,16 +332,19 @@
  273. fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
  274. fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
  275. fprintf (stream, _(" The options are:\n\
  276. - -A|-B|-G --format={sysv|berkeley|gnu} Select output style (default is %s)\n\
  277. - -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
  278. - -t --totals Display the total sizes (Berkeley only)\n\
  279. - --common Display total size for *COM* syms\n\
  280. - --target=<bfdname> Set the binary file format\n\
  281. - @<file> Read options from <file>\n\
  282. - -h --help Display this information\n\
  283. - -v --version Display the program's version\n\
  284. + -A|-B|-G|-C --format={sysv|berkeley|gnu|avr} Select output style (default is %s)\n\
  285. + --mcu=<avrmcu> MCU name for AVR format only\n\
  286. + -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
  287. + -t --totals Display the total sizes (Berkeley only)\n\
  288. + --common Display total size for *COM* syms\n\
  289. + --target=<bfdname> Set the binary file format\n\
  290. + @<file> Read options from <file>\n\
  291. + -h --help Display this information\n\
  292. + -v --version Display the program's version\n\
  293. \n"),
  294. -#if BSD_DEFAULT
  295. +#if AVR_DEFAULT
  296. + "avr"
  297. +#elif BSD_DEFAULT
  298. "berkeley"
  299. #else
  300. "sysv"
  301. @@ -113,6 +359,7 @@
  302. #define OPTION_FORMAT (200)
  303. #define OPTION_RADIX (OPTION_FORMAT + 1)
  304. #define OPTION_TARGET (OPTION_RADIX + 1)
  305. +#define OPTION_MCU (OPTION_TARGET + 1)
  306. static struct option long_options[] =
  307. {
  308. @@ -120,6 +367,7 @@
  309. {"format", required_argument, 0, OPTION_FORMAT},
  310. {"radix", required_argument, 0, OPTION_RADIX},
  311. {"target", required_argument, 0, OPTION_TARGET},
  312. + {"mcu", required_argument, 0, 203},
  313. {"totals", no_argument, &show_totals, 1},
  314. {"version", no_argument, &show_version, 1},
  315. {"help", no_argument, &show_help, 1},
  316. @@ -151,7 +399,7 @@
  317. fatal (_("fatal error: libbfd ABI mismatch"));
  318. set_default_bfd_target ();
  319. - while ((c = getopt_long (argc, argv, "ABGHhVvdfotx", long_options,
  320. + while ((c = getopt_long (argc, argv, "ABGCHhVvdfotx", long_options,
  321. (int *) 0)) != EOF)
  322. switch (c)
  323. {
  324. @@ -170,12 +418,20 @@
  325. case 'g':
  326. selected_output_format = FORMAT_GNU;
  327. break;
  328. + case 'C':
  329. + case 'c':
  330. + selected_output_format = FORMAT_AVR;
  331. + break;
  332. default:
  333. non_fatal (_("invalid argument to --format: %s"), optarg);
  334. usage (stderr, 1);
  335. }
  336. break;
  337. + case OPTION_MCU:
  338. + avrmcu = optarg;
  339. + break;
  340. +
  341. case OPTION_TARGET:
  342. target = optarg;
  343. break;
  344. @@ -212,6 +468,9 @@
  345. case 'G':
  346. selected_output_format = FORMAT_GNU;
  347. break;
  348. + case 'C':
  349. + selected_output_format = FORMAT_AVR;
  350. + break;
  351. case 'v':
  352. case 'V':
  353. show_version = 1;
  354. @@ -654,13 +913,118 @@
  355. printf ("\n\n");
  356. }
  357. +static avr_device_t *
  358. +avr_find_device (void)
  359. +{
  360. + unsigned int i;
  361. + if (avrmcu != NULL)
  362. + {
  363. + for (i = 0; i < sizeof(avr) / sizeof(avr[0]); i++)
  364. + {
  365. + if (strcmp(avr[i].name, avrmcu) == 0)
  366. + {
  367. + /* Match found */
  368. + return (&avr[i]);
  369. + }
  370. + }
  371. + }
  372. + return (NULL);
  373. +}
  374. +
  375. +
  376. +
  377. +static void
  378. +print_avr_format (bfd *file)
  379. +{
  380. + char *avr_name = "Unknown";
  381. + int flashmax = 0;
  382. + int rammax = 0;
  383. + int eeprommax = 0;
  384. + asection *section;
  385. + bfd_size_type my_datasize = 0;
  386. + bfd_size_type my_textsize = 0;
  387. + bfd_size_type my_bsssize = 0;
  388. + bfd_size_type bootloadersize = 0;
  389. + bfd_size_type noinitsize = 0;
  390. + bfd_size_type eepromsize = 0;
  391. +
  392. + avr_device_t *avrdevice = avr_find_device();
  393. + if (avrdevice != NULL)
  394. + {
  395. + avr_name = avrdevice->name;
  396. + flashmax = avrdevice->flash;
  397. + rammax = avrdevice->ram;
  398. + eeprommax = avrdevice->eeprom;
  399. + }
  400. +
  401. + if ((section = bfd_get_section_by_name (file, ".data")) != NULL)
  402. + my_datasize = bfd_section_size (section);
  403. + if ((section = bfd_get_section_by_name (file, ".text")) != NULL)
  404. + my_textsize = bfd_section_size (section);
  405. + if ((section = bfd_get_section_by_name (file, ".bss")) != NULL)
  406. + my_bsssize = bfd_section_size (section);
  407. + if ((section = bfd_get_section_by_name (file, ".bootloader")) != NULL)
  408. + bootloadersize = bfd_section_size (section);
  409. + if ((section = bfd_get_section_by_name (file, ".noinit")) != NULL)
  410. + noinitsize = bfd_section_size (section);
  411. + if ((section = bfd_get_section_by_name (file, ".eeprom")) != NULL)
  412. + eepromsize = bfd_section_size (section);
  413. +
  414. + bfd_size_type text = my_textsize + my_datasize + bootloadersize;
  415. + bfd_size_type data = my_datasize + my_bsssize + noinitsize;
  416. + bfd_size_type eeprom = eepromsize;
  417. +
  418. + printf ("AVR Memory Usage\n"
  419. + "----------------\n"
  420. + "Device: %s\n\n", avr_name);
  421. +
  422. + /* Text size */
  423. + printf ("Program:%8ld bytes", text);
  424. + if (flashmax > 0)
  425. + {
  426. + printf (" (%2.1f%% Full)", ((float)text / flashmax) * 100);
  427. + }
  428. + printf ("\n(.text + .data + .bootloader)\n\n");
  429. +
  430. + /* Data size */
  431. + printf ("Data: %8ld bytes", data);
  432. + if (rammax > 0)
  433. + {
  434. + printf (" (%2.1f%% Full)", ((float)data / rammax) * 100);
  435. + }
  436. + printf ("\n(.data + .bss + .noinit)\n\n");
  437. +
  438. + /* EEPROM size */
  439. + if (eeprom > 0)
  440. + {
  441. + printf ("EEPROM: %8ld bytes", eeprom);
  442. + if (eeprommax > 0)
  443. + {
  444. + printf (" (%2.1f%% Full)", ((float)eeprom / eeprommax) * 100);
  445. + }
  446. + printf ("\n(.eeprom)\n\n");
  447. + }
  448. +}
  449. +
  450. +
  451. +
  452. static void
  453. print_sizes (bfd *file)
  454. {
  455. if (show_common)
  456. calculate_common_size (file);
  457. - if (selected_output_format == FORMAT_SYSV)
  458. - print_sysv_format (file);
  459. - else
  460. - print_berkeley_or_gnu_format (file);
  461. -}
  462. + switch (selected_output_format)
  463. + {
  464. + case FORMAT_SYSV:
  465. + print_sysv_format (file);
  466. + break;
  467. + case FORMAT_BERKLEY:
  468. + case FORMAT_GNU:
  469. + print_berkeley_or_gnu_format (file);
  470. + break;
  471. + case FORMAT_AVR:
  472. + default:
  473. + print_avr_format (file);
  474. + break;
  475. + }
  476. +}