I see what is going on, but don't know how to fix it yet.
Gdb must be checking for program headers that are marked load or
segments that are marked allocate (not exactly sure what yet). The
.symtab and .strtab are not, because normally they are not loaded into
memory.
The problem is bfd_elf_get_elf_syms tries to bfd_seek too far, and
fails. The VDSO looks like:
[Nr] Name Type Address Off Size ES Flg Lk
Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .hash HASH 0000000000000120 000120 00004c 04 A
2 0 8
[ 2] .dynsym DYNSYM 0000000000000170 000170 000150 18 A
3 2 8
[ 3] .dynstr STRTAB 00000000000002c0 0002c0 00010d 00 A
0 0 1
[ 4] .gnu.version VERSYM 00000000000003ce 0003ce 00001c 02 A
2 0 2
[ 5] .gnu.version_d VERDEF 00000000000003f0 0003f0 000038 00 A
3 2 8
[ 6] .note NOTE 0000000000000428 000428 00003c 00 A
0 0 4
[ 7] .text PROGBITS 0000000000000470 000470 000324 00 AX
0 0 8
[ 8] .dynamic DYNAMIC 0000000000000798 000798 000100 10 WA
3 0 8
[ 9] .eh_frame_hdr PROGBITS 0000000000000898 000898 00006c 00 A
0 0 4
[10] .eh_frame PROGBITS 0000000000000908 000908 000538 00 A
0 0 8
[11] .got PROGBITS 0000000000000e40 000e40 000008 08 WA
0 0 8
[12] .debug_aranges PROGBITS 0000000000000000 000e50 0000f0 00
0 0 16
[13] .debug_info PROGBITS 0000000000000000 000f40 00034c 00
0 0 1
[14] .debug_abbrev PROGBITS 0000000000000000 00128c 000064 00
0 0 1
[15] .debug_line PROGBITS 0000000000000000 0012f0 000313 00
0 0 1
[16] .rela.dyn RELA 0000000000000e40 000e40 000000 18 A
2 0 8
[17] .shstrtab STRTAB 0000000000000000 001603 0000be 00
0 0 1
[18] .symtab SYMTAB 0000000000000000 001bc8 000318 18
19 21 8
[19] .strtab STRTAB 0000000000000000 001ee0 000127 00
0 0 1
strace output:
open("/proc/19509/mem", O_RDONLY|O_CLOEXEC) = 10
pread64(10,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\25\0\1\0\0\0p\4\0\0\0\0\0\0"..., 64,
70367535824896) = 64
close(10) = 0
open("/proc/19509/mem", O_RDONLY|O_CLOEXEC) = 10
pread64(10,
"\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 224,
70367535824960) = 224
close(10) = 0
open("/proc/19509/mem", O_RDONLY|O_CLOEXEC) = 10
pread64(10,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\25\0\1\0\0\0p\4\0\0\0\0\0\0"..., 7112,
70367535824896) = 7112
close(10) = 0
We read up to 7112 (0x1bc8), right up to before the symtab. Not sure it
reads to there and not the limit of the program load header or all
section headers marked allocate.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1365664
Title:
gdb source test suites are failing in Ubuntu14.10
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1365664/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs