binutils-gdb/include
Ravi Bangoria 0f6329bd7f binutils/objdump: Fix disassemble for huge elf sections
When elf section size is beyond unsigned int max value, objdump fails
to disassemble from that section. Ex on PowerPC,

  $ objdump -h /proc/kcore
    Idx  Name   Size       VMA
      4  load2  100000000  c000000000000000

Here, size of load2 section is 0x100000000. Also note that, 0xc00....
address range is kernel space for PowerPC. Now let's try to disassemble
do_sys_open() using /proc/kcore.

  $ cat /proc/kallsyms | grep -A1 -w do_sys_open
    c00000000036c000 T do_sys_open
    c00000000036c2d0 T SyS_open

Before patch:

  $ objdump -d --start-address=0xc00000000036c000 --stop-address=0xc00000000036c2d0 /proc/kcore
    /proc/kcore:    file format elf64-powerpcle

    Disassembly of section load2:

    c00000000036c000 <load2+0x36c000>:
    c00000000036c000:    Address 0xc00000000036c000 is out of bounds.

Fix this by changing type of 'buffer_length' from unsigned int to
size_t. After patch:

  $ objdump -d --start-address=0xc00000000036c000 --stop-address=0xc00000000036c2d0 /proc/kcore
    /proc/kcore:    file format elf64-powerpcle

    Disassembly of section load2:

    c00000000036c000 <load2+0x36c000>:
    c00000000036c000: fc 00 4c 3c     addis   r2,r12,252
    c00000000036c004: 00 53 42 38     addi    r2,r2,21248
    c00000000036c008: a6 02 08 7c     mflr    r0

include/
	* dis-asm.h (struct disassemble_info): Change type of buffer_length
	field to size_t.
opcodes/
	* dis-buf.c (buffer_read_memory): Change type of end_addr_offset,
	max_addr_offset and octets variables to size_t.
2017-07-14 22:51:01 +09:30
..
aout Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
cgen Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
coff Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
elf Recognize the recently-added FreeBSD core dump note for LWP info. 2017-07-07 16:10:47 -07:00
gdb update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
mach-o Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
nlm Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
opcode Add support for a __gcc_isr pseudo isntruction to the AVR assembler. 2017-06-30 16:37:39 +01:00
som Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
vms Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
COPYING
COPYING3
ChangeLog binutils/objdump: Fix disassemble for huge elf sections 2017-07-14 22:51:01 +09:30
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-2016 ChangeLog rotation 2017-01-02 13:55:05 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
MAINTAINERS Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
alloca-conf.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
ansidecl.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
bfdlink.h x86: Support Intel Shadow Stack with SHSTK property 2017-06-22 05:50:31 -07:00
binary-io.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
bout.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
demangle.h Sync libiberty sources with GCC. 2017-03-13 17:49:32 +00:00
dis-asm.h binutils/objdump: Fix disassemble for huge elf sections 2017-07-14 22:51:01 +09:30
dwarf2.def Import include/+libiberty/ r249883 from upstream GCC. 2017-07-02 22:09:52 +02:00
dwarf2.h Import include/+libiberty/ r249883 from upstream GCC. 2017-07-02 22:09:52 +02:00
dyn-string.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
environ.h Fix MinGW compilation warnings due to environ.h 2017-05-31 09:35:07 +03:00
fibheap.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
filenames.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
floatformat.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
fnmatch.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
fopen-bin.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
fopen-same.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
fopen-vms.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
gcc-c-fe.def Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
gcc-c-interface.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
gcc-interface.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
getopt.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
hashtab.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
hp-symtab.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
ieee.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
leb128.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
libiberty.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
longlong.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
lto-symtab.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
md5.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
oasys.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
objalloc.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
obstack.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
os9k.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
partition.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
plugin-api.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
progress.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
safe-ctype.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
sha1.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
simple-object.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
sort.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
splay-tree.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
symcat.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
timeval-utils.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
vtv-change-permission.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
xregex.h merge from gcc 2011-07-25 17:11:48 +00:00
xregex2.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
xtensa-config.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
xtensa-isa-internal.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
xtensa-isa.h Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30