This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[bfd patch] Regression for Linux vDSO in GDB


	vdso handling
	Message-ID: <>
I get on
	attaching its vdso.bin.gz
GDB (FSF HEAD 5e43d46791c4c66fd83947a12d4f716b561a9103) regression:
reproducer for Fedora systems (as Fedora glibc is patched):
	./gdb -ex r --args $PWD/../../glibc-root/lib/ --library-path $PWD/../../glibc-root/lib:/lib64 ./gdb
assuming an untested reproducer for more upstream glibc (Debian?); not tested:
	./gdb -ex start ./gdb
actual result / FAIL:
	Got object file from memory but can't read symbols: File truncated.
expected result / PASS:
	warning: Could not load shared library symbols for
	Do you need "set solib-search-path" or "set sysroot"?

That "warning: Could not load shared library..." is mostly harmless (it is
a bug in GDB), in the FAIL case it is not printed just because
bfd_check_format() fails there.

I do not fully understand the original intention for the line I changed there
but it seems logical to me this way when the 'size' parameter has been already

I do not see a regression for add-symbol-file-from-memory for
from the original thread above.

  Start of section headers:          1080 (bytes into file)
  Size of section headers:           64 (bytes)
  Number of section headers:         13
  Section header string table index: 8
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 8] .fake_shstrtab    STRTAB          0000000000000780 000780 000076 00   A  0   0 32
Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x0012fe 0x0012fe R E 0x1000

size == 0x2000
shdr_end == 0x778 == 1080 + 13 * 64
high_offset == 0x12fe

       else if (size >= shdr_end)
-       high_offset = shdr_end;
+	high_offset = size;

But then 0x778 < 0x780 for "Section header string table index" so whole
bfd_check_format() fails because section headers were not cleared here:
  /* If the segments visible in memory didn't include the section headers,
     then clear them from the file header.  */
  if (high_offset < shdr_end)

2014-09-17  Jan Kratochvil  <>

	* elfcode.h (bfd_from_remote_memory): Use SIZE for HIGH_OFFSET.

diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index a49a708..ec53c3b 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1749,7 +1749,7 @@ NAME(_bfd_elf,bfd_from_remote_memory)
 	     headers.  */
       else if (size >= shdr_end)
-	high_offset = shdr_end;
+	high_offset = size;
 	  bfd_vma page_size = get_elf_backend_data (templ)->minpagesize;

Attachment: kernel-3.16.2-200.fc20.x86_64-vdso.bin.gz
Description: application/gzip

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]