c - Understanding GCC generated map files -


i'm trying write script parses .map files generated gcc , me figure out footprints of various libraries in memory. (github repository of have far)

i'm trying understand following means / how should read :

.debug_line     0x00000000     0x67b1  *(.debug_line .debug_line.* .debug_line_end)  .debug_line    0x00000000      0x105 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/crt0.o  .debug_line    0x00000105      0x4b5 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj  .debug_line.text.bc_printf.constprop.1                 0x000005ba       0x23 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj  .debug_line.text.deferred_exec                 0x000005dd       0x60 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj  .debug_line.text.startup.main                 0x0000063d       0xfc cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj  .debug_line_end                 0x00000739        0x0 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj 

i've been assuming first line, not indented, sort of section heading , address (0x0000000) somehow relates contents of section should written. 0x00000000 somehow results in contents being discarded.

the indented lines (those start .debug_line) have address. these addresses, when symbol going written binary, absolute.

.text           0x000048d8     0x3312                 0x000048d8                . = align (0x2)  *(.lower.text.* .lower.text)                 0x000048d8                . = align (0x2)  *(.text .stub .text.* .gnu.linkonce.t.* .text:*)  .text          0x000048d8       0xa4 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/crtbegin.o  .text.bc_printf.constprop.1                 0x0000497c       0x1a cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj 

how address in section heading, or whatever first line should called, translate address in actual symbols , forth? i.e., how 0x00000000 result in symbols being discarded (even though addresses contain may indeed valid writeable locations otherwise)

what indented line beginning *, i.e. *(.debug_line .debug_line.* .debug_line_end) mean? i'm line critical defining treatment of second last line in first snippet, since .debug_line_end isn't defined in way similar how .debug_line in first line of snippet. can't seem find references structure of file, though.

with answers, i'd able understand how .eh_frame in following snippet resolved. can post full map file if it's necessary, suspect information needed somehow encoded within snippet, , @ within top , bottom few lines only.

.rodata         0x00004400      0x464                 0x00004400                . = align (0x2)  *(.plt)                 0x00004400                . = align (0x2)  *(.lower.rodata.* .lower.rodata)                 0x00004400                . = align (0x2)  *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)  .rodata        0x00004400       0x11 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj  *fill*         0x00004411        0x1  .rodata.tusbrequestlist                 0x00004412      0x15c ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x00004412                tusbrequestlist  .rodata.stusbhandle                 0x0000456e       0x40 ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x0000456e                stusbhandle  .rodata.report_desc_hid0                 0x000045ae       0x24 ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x000045ae                report_desc_hid0  .rodata.abromstringdescriptor                 0x000045d2      0x146 ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x000045d2                abromstringdescriptor  .rodata.abromconfigurationdescriptorgroup                 0x00004718       0xef ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x00004718                abromconfigurationdescriptorgroup  .rodata.abromdevicedescriptor                 0x00004807       0x12 ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x00004807                abromdevicedescriptor  *fill*         0x00004819        0x1  .rodata.report_desc_size                 0x0000481a        0x2 ../peripherals/usb_config/libusb-config-msp430f5529.a(descriptors.c.obj)                 0x0000481a                report_desc_size  .rodata        0x0000481c       0x11 ../subsystem/libcontrol-iface-msp430f5529.a(control_iface.c.obj)  *fill*         0x0000482d        0x1  .rodata.gpio_port_to_base                 0x0000482e       0x1c ../peripherals/driverlib/msp430f5xx_6xx/libdriverlib-msp430f5529.a(gpio.c.obj)  .rodata        0x0000484a        0x7 ../lib/libprintf-msp430f5529.a(printf.c.obj)  *(.rodata1)  *(.eh_frame_hdr)  *(.eh_frame)  *fill*         0x00004851        0x3  .eh_frame      0x00004854        0x0 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/crtbegin.o 


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -