zhangutah/binutils-code-2
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
### Static/Global variables #### max_open_files Related code: https://github.com/zhangutah/binutils-code-2/blob/main/bfd/cache.c#L70 max_open_files is initialized to 0 at first and is changed in following code, resulting different value/branch for the next loop. static int max_open_files = 0; ``` #0 0x0000000000650365 in bfd_cache_max_open () at cache.c:113 #1 0x0000000000650142 in bfd_cache_init (abfd=abfd@entry=0x7f7670) at cache.c:498 #2 0x00000000005052ac in bfd_fopen (filename=filename@entry=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=<optimized out>, target@entry=0x0, mode=0x7b100c "r", fd=fd@entry=-1) at opncls.c:279 #3 0x0000000000505526 in bfd_openr (filename=0x7f7670 "\340w\177", filename@entry=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=0x7b100c "r", target@entry=0x0) at opncls.c:322 #4 0x000000000040904b in display_file (filename=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=target@entry=0x0, last_file=true) at ./objdump.c:5330 #5 0x0000000000407a8c in main (argc=<optimized out>, argv=<optimized out>) at ./objdump.c:5706 ``` #### ihex_init.inited related file: https://github.com/zhangutah/binutils-code-2/blob/main/bfd/ihex.c#L163 static bool inited; ``` #0 0x00000000005106af in ihex_init () at ihex.c:170 #1 ihex_object_p (abfd=0x7f7670) at ihex.c:494 #2 0x00000000004ff8c7 in bfd_check_format_matches (abfd=<optimized out>, abfd@entry=0x7f7670, format=<optimized out>, format@entry=b fd_object, matching=matching@entry=0x7fffffffdde0) at format.c:344 #3 0x000000000040928e in display_object_bfd (abfd=0x7f7670) at ./objdump.c:5224 #4 display_any_bfd (file=file@entry=0x7f7670, level=level@entry=0) at ./objdump.c:5316 #5 0x0000000000409078 in display_file (filename=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=<optimized out>, target@entry=0x0, last_file=true) at ./objdump.c:5337 #6 0x0000000000407a8c in main (argc=<optimized out>, argv=<optimized out>) at ./objdump.c:5706 ``` #### srec_init.inited static bool inited = false; ``` #0 0x0000000000514b2e in srec_init () at srec.c:188 #1 symbolsrec_object_p (abfd=0x7f7670) at srec.c:683 #2 0x00000000004ff8c7 in bfd_check_format_matches (abfd=<optimized out>, abfd@entry=0x7f7670, format=<optimized out>, format@entry=bfd_object, matching=matching@entry=0x7fffffffdde0) at format.c:344 #3 0x000000000040928e in display_object_bfd (abfd=0x7f7670) at ./objdump.c:5224 #4 display_any_bfd (file=file@entry=0x7f7670, level=level@entry=0) at ./objdump.c:5316 #5 0x0000000000409078 in display_file (filename=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=<optimized out>, target@entry=0x0, last_file=true) at ./objdump.c:5337 #6 0x0000000000407a8c in main (argc=<optimized out>, argv=<optimized out>) at ./objdump.c:5706 ``` #### tekhex_init.inited static bool inited = false; ``` #0 0x00000000005194ee in tekhex_init () at tekhex.c:228 #1 0x0000000000517412 in tekhex_object_p (abfd=0x7f7670) at tekhex.c:608 #2 0x00000000004ff8c7 in bfd_check_format_matches (abfd=<optimized out>, abfd@entry=0x7f7670, format=<optimized out>, format@entry=bfd_object, matching=matching@entry=0x7fffffffdde0) at format.c:344 #3 0x000000000040928e in display_object_bfd (abfd=0x7f7670) at ./objdump.c:5224 #4 display_any_bfd (file=file@entry=0x7f7670, level=level@entry=0) at ./objdump.c:5316 #5 0x0000000000409078 in display_file (filename=0x7fffffffe34a "/dev/shm/afl_per_out_FS", target=<optimized out>, target@entry=0x0, last_file=true) at ./objdump.c:5337 #6 0x0000000000407a8c in main (argc=<optimized out>, argv=<optimized out>) at ./objdump.c:5706 ``` ### Memory allocation and deallocation (malloc & free) NOTE: When objdump releases memory, it doesn't really reset to 0, and objalloc_free_block will select different branches according to different memory values. The memory residual information of the last cycle will have an impact for objalloc_free_block behavior. ``` 0x0000000000692728 in objalloc_free_block (o=0x7f87b0, block=0x7f8800) at ./objalloc.c:206 206 for (p = (struct objalloc_chunk *) o->chunks; p != NULL; p = p->next) (gdb) bt #0 0x0000000000692728 in objalloc_free_block (o=0x7f87b0, block=0x7f8800) at ./objalloc.c:206 #1 0x0000000000512053 in bfd_release (abfd=abfd@entry=0x7f8670, block=block@entry=0x7f8800) at opncls.c:1069 #2 0x000000000062934f in coff_real_object_p (abfd=abfd@entry=0x7f8670, nscns=<optimized out>, nscns@entry=255, internal_f=<optimized out>, internal_f@entry=0x7fffffffd900, internal_a=<optimized out>) at coffgen.c:307 #3 0x0000000000629ad8 in coff_object_p (abfd=0x7f8670) at coffgen.c:374 #4 0x0000000000501827 in bfd_check_format_matches (abfd=<optimized out>, abfd@entry=0x7f8670, format=<optimized out>, format@entry=bfd_object, matching=matching@entry=0x7fffffffddc0) at format.c:344 #5 0x000000000040946e in display_object_bfd (abfd=0x7f8670) at ./objdump.c:5224 #6 display_any_bfd (file=file@entry=0x7f8670, level=level@entry=0) at ./objdump.c:5316 #7 0x0000000000409258 in display_file (filename=0x7fffffffe331 "/dev/shm/afl_per_out_FS", target=<optimized out>, target@entry=0x0, last_file=true) at ./objdump.c:5337 #8 0x0000000000407c6c in main (argc=<optimized out>, argv=<optimized out>) at ./objdump.c:5706 ``` ================= original README ============== README for GNU development tools This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. If you are receiving this as part of a GDB release, see the file gdb/README. If with a binutils release, see binutils/README; if with a libg++ release, see libg++/README, etc. That'll give you info about this package -- supported targets, how to use it, how to report bugs, etc. It is now possible to automatically configure and build a variety of tools with one command. To build all of the tools contained herein, run the ``configure'' script here, e.g.: ./configure make To install them (by default in /usr/local/bin, /usr/local/lib, etc), then do: make install (If the configure script can't determine your type of computer, give it the name as an argument, for instance ``./configure sun4''. You can use the script ``config.sub'' to test whether a name is recognized; if it is, config.sub translates it to a triplet specifying CPU, vendor, and OS.) If you have more than one compiler on your system, it is often best to explicitly set CC in the environment before running configure, and to also set CC when running make. For example (assuming sh/bash/ksh): CC=gcc ./configure make A similar example using csh: setenv CC gcc ./configure make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or COPYING.LIB in the various directories, for a description of the GNU General Public License terms under which you can copy the files. REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info on where and how to report problems.