[patch,avr] Fix PR31687: Account for .rodata size in avr-objdump -P mem-usage

Georg-Johann Lay avr@gjlay.de
Sun May 5 19:30:11 GMT 2024


AVR: binutils/31684 - Include .rodata size in avr-objdump -P mem-usage.

AVR emulations with a .rodata output section were missing the size
of that section in  avr-objdump -P mem-usage.  This are the emulations
that keep .rodata in program memory, which can be supported by devices
that see (a part of) the program memory in the RAM address space.

The patch also introduces a code clean-up related to PR 27283, which
was about broken binaries that lead to overflow / UB in size computation.
The section size is now just truncated, alongside with a diagnostic about
the truncation and *which* section length is being truncated.

binutils/
	PR binutils/31684
	* od-elf32_avr.c (elf32_avr_get_truncated_size): New static function.
	(elf32_avr_get_memory_usage): Use it to get (truncated) section sizes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr31684-objdump.diff
Type: text/x-patch
Size: 4943 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20240505/eba18d94/attachment.bin>


More information about the Binutils mailing list