[Bug binutils/22494] pocong

2017-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22494

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||nickc at redhat dot com
 Resolution|--- |INVALID

--- Comment #1 from Nick Clifton  ---
spam

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22492] Incorrect note section alignment

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22492

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e3d40582166056dd1dfeef2a06ba8f5897b673ee

commit e3d40582166056dd1dfeef2a06ba8f5897b673ee
Author: Nick Clifton 
Date:   Mon Nov 27 11:04:17 2017 +

When creating a .note section to contain a version note, set the section
alignment to 4 bytes.

PR 22492
* config/obj-elf.c (obj_elf_version): Set the alignment of the
.note section.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22490] segmentation fault: readelf -n corefile

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22490

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4dff97b2ce94bbb9c0c16e0e4129060b9a894f13

commit 4dff97b2ce94bbb9c0c16e0e4129060b9a894f13
Author: Nick Clifton 
Date:   Mon Nov 27 11:05:39 2017 +

Fix a seg-fault when displaying notes from a prorgam segment.  Check for a
NULL string section before attempting compute the name of a separate debug info
file.

PR 22490
* readelf.c (dump_section_as_bytes): Check for a NULL string
section pointer.
(process_notes_at): Compute the alignment to use if displaying
notes from a segment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22492] Incorrect note section alignment

2017-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22492

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||nickc at redhat dot com

--- Comment #2 from Nick Clifton  ---
Hi H.J.

  OK - I have checked in the obvious fix.  But .. do we need 8 byte
  alignment on 64-bit targets ?

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22490] segmentation fault: readelf -n corefile

2017-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22490

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||nickc at redhat dot com

--- Comment #2 from Nick Clifton  ---
Hi H.J.

  I was not able to reproduce this failure as I did not find a auxv.corefile
  in my gdb testsuite directory.  I did however find an auxv.gcore file which
  did trigger a seg-fault in readelf when displaying the notes.  So I have
  created and committed a patch which fixes the seg-fault I found, and which
  *might* fix the seg-fault you found.  Please could you check and update
  this PR with the result ?

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22269

--- Comment #30 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Szabolcs Nagy :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a377ae2ad683d3c16ae74dba440ee441120a7d8a

commit a377ae2ad683d3c16ae74dba440ee441120a7d8a
Author: Szabolcs Nagy 
Date:   Wed Nov 15 15:56:30 2017 +

[PR ld/22269] aarch64: Handle local undefined weak symbols

With static pie linking undefined weak symbols are forced to resolve
locally
to 0, so no GOT setup is needed in elfNN_aarch64_finish_dynamic_symbol,
which previously failed for these symbols.

The failure caused the unhelpful error message:
"ld: final link failed: Nonrepresentable section on output"

bfd/
PR ld/22269
* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Use
UNDEFWEAK_NO_DYNAMIC_RELOC to avoid dynamic GOT relocs.
(elfNN_aarch64_allocate_dynrelocs): Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22263] -fpie -pie generates dynamic relocations in text section

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22263

--- Comment #11 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Szabolcs Nagy :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6dda7875a8021787f11bd95a69d81a079e408a57

commit 6dda7875a8021787f11bd95a69d81a079e408a57
Author: Szabolcs Nagy 
Date:   Wed Nov 15 17:40:04 2017 +

[PR ld/22263] aarch64: Avoid dynamic TLS relocs in PIE

No dynamic relocs are needed for TLS defined in an executable, the
TP relative offset is known at link time.

Fixes
FAIL: Build pr22263-1

bfd/
PR ld/22263
* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use
bfd_link_executable instead of bfd_link_pic for TLS.
(elfNN_aarch64_allocate_dynrelocs): Likewise.
(aarch64_can_relax_tls): Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22492] Incorrect note section alignment

2017-11-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22492

--- Comment #3 from H.J. Lu  ---
(In reply to Nick Clifton from comment #2)
> Hi H.J.
> 
>   OK - I have checked in the obvious fix.  But .. do we need 8 byte
>   alignment on 64-bit targets ?
> 

Given that .note.ABI-tag and .note.gnu.build-id are aligned to 4
bytes in 64-bit objects, we can keep it aligned to 4 bytes in 64-bit
objects.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22490] segmentation fault: readelf -n corefile

2017-11-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22490

--- Comment #3 from H.J. Lu  ---
I still got

[hjl@gnu-tools-1 auxv]$
/export/build/gnu/binutils/build-x86_64-linux/binutils/readelf -n auxv.corefile
readelf: /export/gnu/import/git/sources/binutils-gdb/binutils/readelf.c:658:
find_section: Assertion `filedata->section_headers != NULL' failed.
Aborted
[hjl@gnu-tools-1 auxv]$ 

I have

[hjl@gnu-tools-1 auxv]$ cat /etc/sysctl.d/coredump.conf 
kernel.core_pattern=core
[hjl@gnu-tools-1 auxv]$ 

to restore core file in the current directory.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22502] New: Unable to redefine weak function in LTO incrementally-linked executable

2017-11-27 Thread thopre01 at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22502

Bug ID: 22502
   Summary: Unable to redefine weak function in LTO
incrementally-linked executable
   Product: binutils
   Version: 2.30 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: thopre01 at gcc dot gnu.org
  Target Milestone: ---

Created attachment 10638
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10638&action=edit
Reproducer for failure to incrementally link an executable with LTO

Hi,

Commit 5c3261b0e834647cf9eb555320e20871b7854f98 in binutils broke the ability
to redefine a weak function in an LTO incrementally-linked executable.
Reproducer is attached to this bug report.

Running ./reproducer.sh shows the following error:

test-intermediate: In function `main':
/home/thopre01/issues/sjp/weak_lto_incremental_link/test-weak.c:8: undefined
reference to `foobar'
collect2: error: ld returned 1 exit status

Best regards,

Thomas

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22490] segmentation fault: readelf -n corefile

2017-11-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22490

--- Comment #4 from H.J. Lu  ---
Created attachment 10639
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10639&action=edit
A patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/22266] ld.gold produces invalid output when linking with --relocatable

2017-11-27 Thread bgamari at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22266

--- Comment #13 from Ben Gamari  ---
Has this been re-applied?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22492] Incorrect note section alignment

2017-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22492

Nick Clifton  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Nick Clifton  ---
An extra patch is not needed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22502] Unable to redefine weak function in LTO incrementally-linked executable

2017-11-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22502

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #1 from H.J. Lu  ---
A simpler way to reproduce:

[hjl@gnu-6 pr22502]$ make
gcc -g -O2-c -o test-weak.o test-weak.c
gcc -g -O2  -flto   -c -o test.o test.c
gcc  -g -O2  -o y test-weak.o test.o
test-weak.o: In function `main':
/export/home/hjl/bugs/binutils/pr22502/test-weak.c:8: undefined reference to
`foobar'
collect2: error: ld returned 1 exit status
make: *** [Makefile:16: y] Error 1
[hjl@gnu-6 pr22502]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/22500] make -k check-gold errors in passing option

2017-11-27 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22500

--- Comment #1 from Cary Coutant  ---
The --plugin options use two dashes, so it looks like there's some add-on
that's doing something like s/-p// in your Makefile. Can you attach a copy of
gold/testsuite/Makefile.in from your source directory and
gold/testsuite/Makefile from the build directory? A copy of gold/config.log
might also be helpful.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22502] Unable to redefine weak function in LTO incrementally-linked executable

2017-11-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22502

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.30

--- Comment #2 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/ml/binutils/2017-11/msg00501.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22504] New: MINGW: Linking to libpq.dll produced with MSVC-x64 generates invalid code

2017-11-27 Thread l...@greiz-reinsdorf.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22504

Bug ID: 22504
   Summary: MINGW: Linking to libpq.dll produced with MSVC-x64
generates invalid code
   Product: binutils
   Version: 2.28
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: l...@greiz-reinsdorf.de
  Target Milestone: ---

Created attachment 10640
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10640&action=edit
Sample code to reproduce

Hi! I'm a maintainer of the Ruby binding to PostgreSQL. I'm faced with a linker
issue when linking to PQgetvalue() in the libpq.dll for x64 provided by the
PostgreSQL project. The DLL in question is attached. It is part of the official
PostgreSQL download for Windows-x64:
https://get.enterprisedb.com/postgresql/postgresql-10.0-1-windows-x64.exe

The error can be reproduced by using the attached "segfault.c" file like so. It
fails when auto-import is disabled:

$ x86_64-w64-mingw32-gcc -o segfault.exe segfault.c
-IC:/PROGRA~1/POSTGR~1/10/include -LC:/PROGRA~1/POSTGR~1/10/lib
-Wl,--enable-auto-image-base,--disable-auto-import -lpq
C:\Users\kanis\AppData\Local\Temp\cce46Itr.o:segfault.c:(.text+0x11e):
undefined reference to `PQgetvalue'
collect2.exe: error: ld returned 1 exit status


When auto-import is enabled, then linking succeeds, but the generated code is
invalid:

$ x86_64-w64-mingw32-gcc -o segfault.exe segfault.c
-IC:/PROGRA~1/POSTGR~1/10/include -LC:/PROGRA~1/POSTGR~1/10/lib
-Wl,--enable-auto-image-base,--enable-auto-import -lpq
$ objdump -d segfault.exe

[...]
  401650:   48 8b 45 f0 mov-0x10(%rbp),%rax
  401654:   41 b8 00 00 00 00   mov$0x0,%r8d
  40165a:   ba 00 00 00 00  mov$0x0,%edx
  40165f:   48 89 c1mov%rax,%rcx
  401662:   e8 d9 17 00 00  callq  402e40 
  401667:   89 45 ecmov%eax,-0x14(%rbp)
  40166a:   8b 45 ecmov-0x14(%rbp),%eax
  40166d:   89 c2   mov%eax,%edx
  40166f:   48 8d 0d e4 29 00 00lea0x29e4(%rip),%rcx#
40405a <.rdata+0x5a>
  401676:   e8 25 16 00 00  callq  402ca0 
  40167b:   48 8b 45 f0 mov-0x10(%rbp),%rax
  40167f:   41 b8 00 00 00 00   mov$0x0,%r8d
  401685:   ba 00 00 00 00  mov$0x0,%edx
  40168a:   48 89 c1mov%rax,%rcx
  40168d:   e8  .byte 0xe8

0040168e <__fu0_PQgetvalue>:
  40168e:   66 6d   insw   (%dx),%es:(%rdi)
  401690:   00 00   add%al,(%rax)
  401692:   48 89 45 e0 mov%rax,-0x20(%rbp)
  401696:   48 8b 45 e0 mov-0x20(%rbp),%rax
  40169a:   48 89 c2mov%rax,%rdx
  40169d:   48 8d 0d bf 29 00 00lea0x29bf(%rip),%rcx#
404063 <.rdata+0x63>
  4016a4:   e8 f7 15 00 00  callq  402ca0 
[...]

$ ./segfault.exe
conn: 007AA7D0
PQlibVersion: 10
res: 007B7120
len: 3
[segfault here]

The call to PQgetlength() and printf() runs through, but it segfaults on
0x40168d, because the address of callq (opcode 0xe8) is invalid. Obviously the
debug information also doesn't fit to the produced code, so that the opcodes
are not properly decoded.

Other functions like PQgetlength() are not affected. They link fine with
auto-import being enabled or disabled. The only function with this odd behavior
is PQgetvalue().

As a workaround "-l:libpq.lib" can be used to trigger linking to libpq.dll per
MSVC import library. This works for gcc-7.2.0, but older versions of gcc
(4.7.2) fail to link to any function of a MSVC produced libpq.lib file (for
some obviously fixed reason).

The issue doesn't appear when building for 32 bit x86 or when linking to a
libpq.dll produced by MINGW.


The root issue is also reproducible on Appveyor:
https://ci.appveyor.com/project/larskanis/ruby-pg-xa3f5/build/1.0.65/job/b06idaids8el773r


My environment:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-7.2.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=

[Bug ld/22504] MINGW: Linking to libpq.dll produced with MSVC-x64 generates invalid code

2017-11-27 Thread l...@greiz-reinsdorf.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22504

Lars Kanis  changed:

   What|Removed |Added

 CC||l...@greiz-reinsdorf.de

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22504] MINGW: Linking to libpq.dll produced with MSVC-x64 generates invalid code

2017-11-27 Thread l...@greiz-reinsdorf.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22504

--- Comment #1 from Lars Kanis  ---
Created attachment 10641
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10641&action=edit
The DLL in question produced by MSVC

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22504] MINGW: Linking to libpq.dll produced with MSVC-x64 generates invalid code

2017-11-27 Thread l...@greiz-reinsdorf.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22504

--- Comment #2 from Lars Kanis  ---
This issue was posted first here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83180

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/22266] ld.gold produces invalid output when linking with --relocatable

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22266

--- Comment #14 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Cary Coutant :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=033bfb739b525703bfe23f151d09e9beee3a2afe

commit 033bfb739b525703bfe23f151d09e9beee3a2afe
Author: Cary Coutant 
Date:   Mon Nov 27 17:32:55 2017 -0800

Fix symbol values and relocation addends for relocatable links.

The fix for PR 19291 broke some other cases where -r is used with scripts,
as reported in PR 22266. The original fix for PR 22266 ended up breaking
many cases for REL targets, where the addends are stored in the section
data,
and are not being adjusted properly.

The problem was basically that in a relocatable output file (ET_REL),
symbol values are supposed to be relative to the start address of their
section. Usually in a relocatable file, all sections start at 0, so the
failure to get this right is often irrelevant, but with a linker script,
we occasionally see an output section whose starting address is not 0,
and gold would occasionally write a symbol with its relocated value instead
of its section-relative value.

This patch reverts the recent fix for PR 22266 as well as my original fix
for PR 19291. The original fix moved the symbol value adjustment to
write_local_symbols, but neglected to undo a few places where the
adjustment
was also being applied, resulting in an occasional double adjustment. The
more recent fix removed those other adjustments, but then failed to
re-account for the adjustment when rewriting the relocations on REL
targets.

With the old attempts reverted, we now apply the symbol value adjustment to
the one case that had been missed (non-section symbols in merge sections).
But now we also need to account for the adjustment when rewriting the
addends
for RELA relocations.

gold/
PR gold/19291
PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.  Adjust symbol value in
relocatable links for non-section symbols.
(Sized_relobj_file::compute_final_local_value): Revert changes from
2017-11-08 patch.
(Sized_relobj_file::do_finalize_local_symbols): Likewise.
(Sized_relobj_file::write_local_symbols): Revert changes from
2015-11-25 patch.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.
* powerpc.cc (Target_powerpc::relocate_relocs): Adjust addend for
relocatable links.
* target-reloc.h (relocate_relocs): Adjust addend for relocatable
links.
* testsuite/pr22266_a.c (hello): New function.
* testsuite/pr22266_main.c (main): Add test for merge sections.
* testsuite/pr22266_script.t: Add rule for .rodata.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19291] constant strings still don't always get relocated properly in a relocatable built with gold --script

2017-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=19291

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Cary Coutant :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=033bfb739b525703bfe23f151d09e9beee3a2afe

commit 033bfb739b525703bfe23f151d09e9beee3a2afe
Author: Cary Coutant 
Date:   Mon Nov 27 17:32:55 2017 -0800

Fix symbol values and relocation addends for relocatable links.

The fix for PR 19291 broke some other cases where -r is used with scripts,
as reported in PR 22266. The original fix for PR 22266 ended up breaking
many cases for REL targets, where the addends are stored in the section
data,
and are not being adjusted properly.

The problem was basically that in a relocatable output file (ET_REL),
symbol values are supposed to be relative to the start address of their
section. Usually in a relocatable file, all sections start at 0, so the
failure to get this right is often irrelevant, but with a linker script,
we occasionally see an output section whose starting address is not 0,
and gold would occasionally write a symbol with its relocated value instead
of its section-relative value.

This patch reverts the recent fix for PR 22266 as well as my original fix
for PR 19291. The original fix moved the symbol value adjustment to
write_local_symbols, but neglected to undo a few places where the
adjustment
was also being applied, resulting in an occasional double adjustment. The
more recent fix removed those other adjustments, but then failed to
re-account for the adjustment when rewriting the relocations on REL
targets.

With the old attempts reverted, we now apply the symbol value adjustment to
the one case that had been missed (non-section symbols in merge sections).
But now we also need to account for the adjustment when rewriting the
addends
for RELA relocations.

gold/
PR gold/19291
PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.  Adjust symbol value in
relocatable links for non-section symbols.
(Sized_relobj_file::compute_final_local_value): Revert changes from
2017-11-08 patch.
(Sized_relobj_file::do_finalize_local_symbols): Likewise.
(Sized_relobj_file::write_local_symbols): Revert changes from
2015-11-25 patch.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.
* powerpc.cc (Target_powerpc::relocate_relocs): Adjust addend for
relocatable links.
* target-reloc.h (relocate_relocs): Adjust addend for relocatable
links.
* testsuite/pr22266_a.c (hello): New function.
* testsuite/pr22266_main.c (main): Add test for merge sections.
* testsuite/pr22266_script.t: Add rule for .rodata.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/22266] ld.gold produces invalid output when linking with --relocatable

2017-11-27 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22266

Cary Coutant  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #15 from Cary Coutant  ---
Should be fixed on trunk now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22506] New: Segmentation fault in coff_i386_reloc

2017-11-27 Thread mgcho.minic at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22506

Bug ID: 22506
   Summary: Segmentation fault in coff_i386_reloc
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: mgcho.minic at gmail dot com
  Target Milestone: ---

Created attachment 10642
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10642&action=edit
poc of the crash

Triggered by "./objdump -W $POC"
Tested on Ubuntu 16.04 (x86)

Segmentation fault occurred when processing malformed PE file


The GDB debugging information is as follows:

(gdb) r -W $POC

Starting program: ./objdump -W ~/Downloads/perform_reloc

/home/min/Downloads/perform_reloc: file format pei-i386

Contents of the  section:

 ZERO terminator


./objdump: /home/min/Downloads/perform_reloc: warning: illegal symbol index
131072 in relocs
./objdump: /home/min/Downloads/perform_reloc: warning: illegal symbol index 0
in relocs


Breakpoint 1, coff_i386_reloc (abfd=0x8256a08, reloc_entry=0x825a07c,
symbol=0x8225ad0 , 
data=0x825b210, input_section=0x8257b9c, output_bfd=0x0,
error_message=0xbfffea84) at ./coff-i386.c:81
81if (bfd_is_com_section (symbol->section))

(gdb) p *reloc_entry 
$11 = {sym_ptr_ptr = 0x824faa4 <_bfd_std_section+488>, address = 7864211,
addend = 0, 
  howto = 0x822f0dc }

Program received signal SIGSEGV, Segmentation fault.
0x080c6045 in bfd_getl32 (p=0x89db1a3) at libbfd.c:557
557   v = (unsigned long) addr[0];

(gdb) bt
#0  0x080c6045 in bfd_getl32 (p=0x89db1a3) at libbfd.c:557
#1  0x08152787 in coff_i386_reloc (abfd=0x8256a08, reloc_entry=0x825a07c,
symbol=0x8225ad0 , 
data=0x825b210, input_section=0x8257b9c, output_bfd=0x0,
error_message=0xbfffea84) at ./coff-i386.c:167
#2  0x08177fce in bfd_perform_relocation (abfd=0x8256a08,
reloc_entry=0x825a07c, data=0x825b210, 
input_section=0x8257b9c, output_bfd=0x0, error_message=0xbfffea84) at
reloc.c:622
#3  0x0817987d in bfd_generic_get_relocated_section_contents (abfd=0x8256a08,
link_info=0xbfffebf0, 
link_order=0xbfffebd8, data=0x825b210 "S mode.\r\r\n$", relocatable=0,
symbols=0x825b3a0) at reloc.c:8200
#4  0x080bef47 in bfd_get_relocated_section_contents (abfd=0x8256a08,
link_info=0xbfffebf0, 
link_order=0xbfffebd8, data=0x825b210 "S mode.\r\r\n$", relocatable=0,
symbols=0x825b3a0) at bfd.c:1930
#5  0x080cb551 in bfd_simple_get_relocated_section_contents (abfd=0x8256a08,
sec=0x8257b9c, 
outbuf=0x825b210 "S mode.\r\r\n$", symbol_table=0x825b3a0) at simple.c:264
#6  0x08049e7a in load_specific_debug_section (debug=eh_frame, sec=0x8257b9c,
file=0x8256a08) at ./objdump.c:2496
#7  0x0804dc41 in dump_dwarf_section (abfd=0x8256a08, section=0x8257b9c,
arg=0x0) at ./objdump.c:2634
#8  0x080cab5c in bfd_map_over_sections (abfd=0x8256a08, operation=0x804daf0
, 
user_storage=0x0) at section.c:1395
#9  0x0804c906 in dump_dwarf (abfd=0x8256a08) at ./objdump.c:2703
#10 0x0804b97b in dump_bfd (abfd=0x8256a08) at ./objdump.c:3544
#11 0x0804b5d2 in display_object_bfd (abfd=0x8256a08) at ./objdump.c:3611
#12 0x0804b587 in display_any_bfd (file=0x8256a08, level=0) at ./objdump.c:3700
#13 0x0804b2b1 in display_file (filename=0xb2ef
"/home/min/Downloads/perform_reloc", target=0x0, last_file=1)
at ./objdump.c:3721
#14 0x0804ae80 in main (argc=3, argv=0xb0d4) at ./objdump.c:4023


Credits:

Mingi Cho and Taekyoung Kwon of the Information Security Lab, Yonsei
University.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22507] New: Heap buffer overflow on _bfd_coff_read_string_table

2017-11-27 Thread mgcho.minic at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22507

Bug ID: 22507
   Summary: Heap buffer overflow on _bfd_coff_read_string_table
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: mgcho.minic at gmail dot com
  Target Milestone: ---

Created attachment 10643
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10643&action=edit
poc of the crash

Triggered by "./objdump -W $POC"
Tested on Ubuntu 16.04 (x86)

Heap overflow occurred when processing malformed PE file.


The GDB debugging information is as follows:

(gdb) r -W $POC

Program received signal SIGABRT, Aborted.
0xb7fd9ce5 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fd9ce5 in __kernel_vsyscall ()
#1  0xb7e2aea9 in __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#2  0xb7e2c407 in __GI_abort () at abort.c:89
#3  0xb7e6637c in __libc_message (do_abort=2, fmt=0xb7f5edf4 "*** Error in
`%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#4  0xb7e6c2f7 in malloc_printerr (action=, str=0xb7f5eef0
"free(): invalid next size (fast)", 
ptr=, ar_ptr=0xb7fb1780 ) at malloc.c:5006
#5  0xb7e6cc31 in _int_free (av=0xb7fb1780 , p=,
have_lock=0) at malloc.c:3867
#6  0x0816a700 in _bfd_coff_read_string_table (abfd=0x825ca08) at
coffgen.c:1743
#7  0x0816d3c9 in coff_get_normalized_symtab (abfd=0x825ca08) at coffgen.c:1956
#8  0x08153f38 in coff_slurp_symbol_table (abfd=0x825ca08) at ./coffcode.h:4783
#9  0x0816a2e6 in coff_get_symtab_upper_bound (abfd=0x825ca08) at coffgen.c:419
#10 0x0804c347 in slurp_symtab (abfd=0x825ca08) at ./objdump.c:615
#11 0x0804b99c in dump_bfd (abfd=0x825ca08) at ./objdump.c:3561
#12 0x0804b742 in display_object_bfd (abfd=0x825ca08) at ./objdump.c:3649
#13 0x0804b6f7 in display_any_bfd (file=0x825ca08, level=0) at ./objdump.c:3738
#14 0x0804b421 in display_file (filename=0xb2b0
"/home/min/Downloads/bfd_coff_read_string_table", target=0x0, 
last_file=1) at ./objdump.c:3759
#15 0x0804aff0 in main (argc=3, argv=0xb094) at ./objdump.c:4061


ASAN output:

==7711==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb61006b1 at
pc 0x080f9f75 bp 0xbfe82888 sp 0xbfe82460
WRITE of size 4 at 0xb61006b1 thread T0
#0 0x80f9f74 in __asan_memset
(/home/min/fuzzing/program/binutils-master-patch/bin/objdump+0x80f9f74)
#1 0x85ed97d in _bfd_coff_read_string_table
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:1738:3
#2 0x85fdab1 in coff_get_normalized_symtab
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:1956:20
#3 0x8578d09 in coff_slurp_symbol_table
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/./coffcode.h:4783:25
#4 0x85ec86c in coff_get_symtab_upper_bound
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:419:8
#5 0x81476cb in slurp_symtab
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:615:13
#6 0x8145950 in dump_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3561:12
#7 0x81450ef in display_object_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3649:7
#8 0x8144ffb in display_any_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3738:5
#9 0x8144aa0 in display_file
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3759:3
#10 0x814421e in main
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:4061:6
#11 0xb7498636 in __libc_start_main
/build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291
#12 0x806c7c7 in _start
(/home/min/fuzzing/program/binutils-master-patch/bin/objdump+0x806c7c7)

0xb61006b1 is located 0 bytes to the right of 1-byte region
[0xb61006b0,0xb61006b1)
allocated by thread T0 here:
#0 0x8110b04 in malloc
(/home/min/fuzzing/program/binutils-master-patch/bin/objdump+0x8110b04)
#1 0x82cc0d2 in bfd_malloc
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/libbfd.c:193:9
#2 0x85ed92a in _bfd_coff_read_string_table
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:1730:22
#3 0x85fdab1 in coff_get_normalized_symtab
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:1956:20
#4 0x8578d09 in coff_slurp_symbol_table
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/./coffcode.h:4783:25
#5 0x85ec86c in coff_get_symtab_upper_bound
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/coffgen.c:419:8
#6 0x81476cb in slurp_symtab
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:615:13
#7 0x8145950 in dump_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3561:12
#8 0x81450ef in display_object_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3649:7
#9 0x8144ffb in display_any_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3738:5
#10 0x8144aa0 in display_file
/home/min/fuzzing/src/binu

[Bug binutils/22508] New: Heap overflow in dump_relocs_in_section

2017-11-27 Thread mgcho.minic at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22508

Bug ID: 22508
   Summary: Heap overflow in dump_relocs_in_section
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: mgcho.minic at gmail dot com
  Target Milestone: ---

Created attachment 10644
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10644&action=edit
poc of the crash

Triggered by "./objdump -x $POC"
Tested on Ubuntu 16.04 (x86)

Heap overflow occurred when processing malformed PE file.


The GDB debugging information is as follows:

Program received signal SIGABRT, Aborted.
0xb7fd9ce5 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fd9ce5 in __kernel_vsyscall ()
#1  0xb7e2aea9 in __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#2  0xb7e2c407 in __GI_abort () at abort.c:89
#3  0xb7e6637c in __libc_message (do_abort=2, fmt=0xb7f5edf4 "*** Error in
`%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#4  0xb7e6c2f7 in malloc_printerr (action=, str=0xb7f5eeac
"double free or corruption (out)", 
ptr=, ar_ptr=0xb7fb1780 ) at malloc.c:5006
#5  0xb7e6cc31 in _int_free (av=0xb7fb1780 , p=,
have_lock=0) at malloc.c:3867
#6  0xb7e285e6 in _nl_make_l10nflist (l10nfile_list=0xb7fb2180
<_nl_loaded_domains>, 
dirlist=0x825c7a8
"/home/min/fuzzing/program/binutils-master-patch-noasan/share/locale",
dirlist_len=68, 
mask=0, language=0xbfffeb70 "en_US", territory=0x0, codeset=0x0,
normalized_codeset=0x0, modifier=0x0, 
filename=0xbfffeb90 "LC_MESSAGES/binutils.mo", do_allocate=0) at
l10nflist.c:237
#7  0xb7e260a2 in _nl_find_domain (
dirname=dirname@entry=0x825c7a8
"/home/min/fuzzing/program/binutils-master-patch-noasan/share/locale", 
locale=locale@entry=0xbfffeb70 "en_US",
domainname=domainname@entry=0xbfffeb90 "LC_MESSAGES/binutils.mo", 
domainbinding=0x825c788) at finddomain.c:91
#8  0xb7e25a20 in __dcigettext (domainname=0x825c7f0 "binutils",
msgid1=0x81b39fc "failed to read relocs in: %s", 
msgid2=0x0, plural=0, n=0, category=5) at dcigettext.c:722
#9  0xb7e248b6 in __GI___dcgettext (domainname=0x0, msgid=0x81b39fc "failed to
read relocs in: %s", category=5)
at dcgettext.c:47
#10 0xb7e248f0 in __gettext (msgid=0x81b39fc "failed to read relocs in: %s") at
gettext.c:55
#11 0x0804e5a2 in dump_relocs_in_section (abfd=0x825ca08, section=0x825ddb8,
dummy=0x0) at ./objdump.c:3443
#12 0x080cd36c in bfd_map_over_sections (abfd=0x825ca08, operation=0x804e3d0
, 
user_storage=0x0) at section.c:1395
#13 0x0804cbae in dump_relocs (abfd=0x825ca08) at ./objdump.c:3460
#14 0x0804bb28 in dump_bfd (abfd=0x825ca08) at ./objdump.c:3586
#15 0x0804b742 in display_object_bfd (abfd=0x825ca08) at ./objdump.c:3649
---Type  to continue, or q  to quit---
#16 0x0804b6f7 in display_any_bfd (file=0x825ca08, level=0) at ./objdump.c:3738
#17 0x0804b421 in display_file (filename=0xb2a7
"/home/min/Downloads/heapoverflow_coff_slurp_reloc_table", 
target=0x0, last_file=1) at ./objdump.c:3759
#18 0x0804aff0 in main (argc=3, argv=0xb094) at ./objdump.c:4061


ASAN output:

==7862==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb4509cec at
pc 0x0857747b bp 0xbfcee988 sp 0xbfcee97c
WRITE of size 4 at 0xb4509cec thread T0
#0 0x857747a in coff_slurp_reloc_table
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/./coffcode.h:5336:26
#1 0x8567bc3 in coff_canonicalize_reloc
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/./coffcode.h:5452:13
#2 0x82af16d in bfd_canonicalize_reloc
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/bfd.c:1372:10
#3 0x814e3c4 in dump_relocs_in_section
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3438:14
#4 0x82da95e in bfd_map_over_sections
/home/min/fuzzing/src/binutils/binutils-gdb/bfd/section.c:1395:5
#5 0x8148f3d in dump_relocs
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3460:3
#6 0x8145c58 in dump_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3586:5
#7 0x81450ef in display_object_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3649:7
#8 0x8144ffb in display_any_bfd
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3738:5
#9 0x8144aa0 in display_file
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:3759:3
#10 0x814421e in main
/home/min/fuzzing/src/binutils/binutils-gdb/binutils/./objdump.c:4061:6
#11 0xb748b636 in __libc_start_main
/build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291
#12 0x806c7c7 in _start
(/home/min/fuzzing/program/binutils-master-patch/bin/objdump+0x806c7c7)

0xb4509cec is located 4 bytes to the right of 4072-byte region
[0xb4508d00,0xb4509ce8)
allocated by thread T0 here:
#0 0x8110b04 in malloc
(/home/min/fuzzing/program/binutils-master-patch/bin/objdump+0x8110b04)
#1 0x870d

[Bug binutils/22509] New: Null pointer dereference on coff_slurp_reloc_table

2017-11-27 Thread mgcho.minic at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22509

Bug ID: 22509
   Summary: Null pointer dereference  on coff_slurp_reloc_table
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: mgcho.minic at gmail dot com
  Target Milestone: ---

Created attachment 10645
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10645&action=edit
poc of the crash

Triggered by "./objdump -W $POC"
Tested on Ubuntu 16.04 (x86)

Null pointer dereference occurred when processing malformed PE file.


The GDB debugging information is as follows:

Program received signal SIGSEGV, Segmentation fault.
0x08153c96 in coff_slurp_reloc_table (abfd=0x825ca08, asect=0x825db9c,
symbols=0x0) at ./coffcode.h:5353
5353  ptr = *(cache_ptr->sym_ptr_ptr);

(gdb) bt
#0  0x08153c96 in coff_slurp_reloc_table (abfd=0x825ca08, asect=0x825db9c,
symbols=0x0) at ./coffcode.h:5353
#1  0x0815026a in coff_canonicalize_reloc (abfd=0x825ca08, section=0x825db9c,
relptr=0x8260e28, symbols=0x0)
at ./coffcode.h:5452
#2  0x080c105b in bfd_canonicalize_reloc (abfd=0x825ca08, asect=0x825db9c,
location=0x8260e28, symbols=0x0)
at bfd.c:1372
#3  0x08049fcd in load_specific_debug_section (debug=eh_frame, sec=0x825db9c,
file=0x825ca08) at ./objdump.c:2524
#4  0x0804de0b in dump_dwarf_section (abfd=0x825ca08, section=0x825db9c,
arg=0x0) at ./objdump.c:2665
#5  0x080cd36c in bfd_map_over_sections (abfd=0x825ca08, operation=0x804dcb0
, 
user_storage=0x0) at section.c:1395
#6  0x0804ca8d in dump_dwarf (abfd=0x825ca08) at ./objdump.c:2738
#7  0x0804baeb in dump_bfd (abfd=0x825ca08) at ./objdump.c:3582
#8  0x0804b742 in display_object_bfd (abfd=0x825ca08) at ./objdump.c:3649
#9  0x0804b6f7 in display_any_bfd (file=0x825ca08, level=0) at ./objdump.c:3738
#10 0x0804b421 in display_file (filename=0xb2af
"/home/min/Downloads/null_coff_slurp_reloc_table", 
target=0x0, last_file=1) at ./objdump.c:3759
#11 0x0804aff0 in main (argc=3, argv=0xb094) at ./objdump.c:4061

(gdb) p *cache_ptr->sym_ptr_ptr 
Cannot access memory at address 0x0


ASAN output:

==7926==ERROR: AddressSanitizer: SEGV on unknown address 0x (pc
0x085014b4 bp 0xb6100650 sp 0xbffd7690 T0)
#0 0x85014b3 in coff_slurp_reloc_table
/home/min/fuzzing/src/binutils-2.29.1/bfd/./coffcode.h:5336:14
#1 0x85014b3 in coff_canonicalize_reloc
/home/min/fuzzing/src/binutils-2.29.1/bfd/./coffcode.h:5435
#2 0x82e9f82 in bfd_canonicalize_reloc
/home/min/fuzzing/src/binutils-2.29.1/bfd/bfd.c:1074:10
#3 0x81404bd in load_specific_debug_section
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:2511:18
#4 0x814a5a2 in dump_dwarf_section
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:2626:6
#5 0x830c34b in bfd_map_over_sections
/home/min/fuzzing/src/binutils-2.29.1/bfd/section.c:1395:5
#6 0x8148a07 in dump_dwarf
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:2695:3
#7 0x8145058 in dump_bfd
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:3536:5
#8 0x8143726 in display_object_bfd
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:3603:7
#9 0x8143726 in display_any_bfd
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:3692
#10 0x814267d in display_file
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:3713:3
#11 0x814267d in main
/home/min/fuzzing/src/binutils-2.29.1/binutils/./objdump.c:4015
#12 0xb74be636 in __libc_start_main
/build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291
#13 0x806c367 in _start
(/home/min/fuzzing/program/binutils-2.29.1-fast/bin/objdump+0x806c367)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/home/min/fuzzing/src/binutils-2.29.1/bfd/./coffcode.h:5336:14 in
coff_slurp_reloc_table


Credits:

Mingi Cho and Taekyoung Kwon of the Information Security Lab, Yonsei
University.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils