[Bug ld/25910] Support --export-dynamic-symbol $symbol

2020-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25910

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #2 from H.J. Lu  ---
(In reply to Fangrui Song from comment #1)
> https://sourceware.org/pipermail/binutils/2020-May/110930.html [PATCH] ld:
> Add --export-dynamic-symbol
> 
> Note, in gold and lld, --export-dynamic-symbol foo does not add foo to
> .symtab if foo does not exist. I prefer the semantics, but (I don't know hot

When foo is undefined,

1. If foo isn't referenced, --export-dynamic-symbol foo should be NOP since
there is nothing to export.
2. If foo is referenced, --export-dynamic-symbol foo should be NOP since foo
should be dynamic.

> to implement the semantics) my patch behaves like regular -u: there is an
> undefined symbol in .symtab . This difference does not really in practice,
> though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/25914] New: Bad free in binutils-2.34/bfd/coffgen.c:1782

2020-05-03 Thread xiaoxiong_wang at foxmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25914

Bug ID: 25914
   Summary: Bad free in binutils-2.34/bfd/coffgen.c:1782
   Product: binutils
   Version: 2.34
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: xiaoxiong_wang at foxmail dot com
  Target Milestone: ---

Created attachment 12500
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12500&action=edit
The file can cause objdump crash with the parameter -d.

Tested in Ubuntu 16.04, 64bit.

I use the following command:

```shell
./objdump -d bad_free
```

and get (absolute path information omitted):

```
bad_free: file format pei-i386


Disassembly of section .text:

 <��>:
   0:   ff 25 00 00 00 00   jmp*0x0
   6:   90  nop
   7:   90  nop
*** Error in `./objdump': free(): invalid pointer: 0x0104ab90 ***
=== Backtrace: =
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fc81e8287e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fc81e83137a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fc81e83553c]
./objdump[0x87d831]
./objdump[0x61e7b3]
./objdump[0x40b569]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fc81e7d1830]
./objdump[0x40c2a9]
=== Memory map: 
0040-00b23000 r-xp  103:01 21657469 
./objdump
00d22000-00d23000 r--p 00722000 103:01 21657469 
./objdump
00d23000-00d2b000 rw-p 00723000 103:01 21657469 
./objdump
00d2b000-00d34000 rw-p  00:00 0 
01046000-01067000 rw-p  00:00 0  [heap]
7fc81800-7fc818021000 rw-p  00:00 0 
7fc818021000-7fc81c00 ---p  00:00 0 
7fc81e10e000-7fc81e125000 r-xp  103:01 10504621 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7fc81e125000-7fc81e324000 ---p 00017000 103:01 10504621 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7fc81e324000-7fc81e325000 r--p 00016000 103:01 10504621 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7fc81e325000-7fc81e326000 rw-p 00017000 103:01 10504621 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7fc81e326000-7fc81e7b1000 r--p  103:01 14811834 
/usr/lib/locale/locale-archive
7fc81e7b1000-7fc81e971000 r-xp  103:01 10487655 
/lib/x86_64-linux-gnu/libc-2.23.so
7fc81e971000-7fc81eb71000 ---p 001c 103:01 10487655 
/lib/x86_64-linux-gnu/libc-2.23.so
7fc81eb71000-7fc81eb75000 r--p 001c 103:01 10487655 
/lib/x86_64-linux-gnu/libc-2.23.so
7fc81eb75000-7fc81eb77000 rw-p 001c4000 103:01 10487655 
/lib/x86_64-linux-gnu/libc-2.23.so
7fc81eb77000-7fc81eb7b000 rw-p  00:00 0 
7fc81eb7b000-7fc81eb7e000 r-xp  103:01 10485854 
/lib/x86_64-linux-gnu/libdl-2.23.so
7fc81eb7e000-7fc81ed7d000 ---p 3000 103:01 10485854 
/lib/x86_64-linux-gnu/libdl-2.23.so
7fc81ed7d000-7fc81ed7e000 r--p 2000 103:01 10485854 
/lib/x86_64-linux-gnu/libdl-2.23.so
7fc81ed7e000-7fc81ed7f000 rw-p 3000 103:01 10485854 
/lib/x86_64-linux-gnu/libdl-2.23.so
7fc81ed7f000-7fc81eda5000 r-xp  103:01 10485855 
/lib/x86_64-linux-gnu/ld-2.23.so
7fc81ef71000-7fc81ef75000 rw-p  00:00 0 
7fc81ef9c000-7fc81ef9d000 rw-p  00:00 0 
7fc81ef9d000-7fc81efa4000 r--s  103:01 15079042 
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7fc81efa4000-7fc81efa5000 r--p 00025000 103:01 10485855 
/lib/x86_64-linux-gnu/ld-2.23.so
7fc81efa5000-7fc81efa6000 rw-p 00026000 103:01 10485855 
/lib/x86_64-linux-gnu/ld-2.23.so
7fc81efa6000-7fc81efa7000 rw-p  00:00 0 
7ffdb18b5000-7ffdb18d7000 rw-p  00:00 0 
[stack]
7ffdb1988000-7ffdb198b000 r--p  00:00 0  [vvar]
7ffdb198b000-7ffdb198d000 r-xp  00:00 0  [vdso]
ff60-ff601000 r-xp  00:00 0 
[vsyscall]
Aborted (core dumped)

```

I use **AddressSanitizer** to build binutils2.34 and running objdump with the
following command:

```shell
./objdump -d bad_free
```

This is the ASAN information (absolute path information omitted):

```
bad_free: file format pei-i386


crashes/crashes1/id:00,sig:06,src:002244,op:flip1,pos:12: file format
pei-i386


Disassembly of section .text:

 <��>:
   0:   ff 25 00 00 00 00   jmp*0x0
   6:   90  nop
   7:   90  nop
=
==17144==ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed: 0x61e0f4e0 in thread T0
#0 0x7fa6f620432a in __interceptor_free
(/usr/

[Bug binutils/25447] objcopy : free() invalid pointer in _bfd_coff_free_symbols

2020-05-03 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25447

Alan Modra  changed:

   What|Removed |Added

 CC||xiaoxiong_wang at foxmail dot 
com

--- Comment #8 from Alan Modra  ---
*** Bug 25914 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/25914] Bad free in binutils-2.34/bfd/coffgen.c:1782

2020-05-03 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25914

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||amodra at gmail dot com
 Resolution|--- |DUPLICATE

--- Comment #1 from Alan Modra  ---
Fixed already.

*** This bug has been marked as a duplicate of bug 25447 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gprof/25915] New: Fail Fake

2020-05-03 Thread harrisbritt6904.0 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25915

Bug ID: 25915
   Summary: Fail Fake
   Product: binutils
   Version: pre-2.12
   URL: https://failfake.com/pl/
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gprof
  Assignee: unassigned at sourceware dot org
  Reporter: harrisbritt6904.0 at gmail dot com
  Target Milestone: ---

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gprof/25915] Fail Fake

2020-05-03 Thread harrisbritt6904.0 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25915

--- Comment #1 from harris britt  ---
It is solved

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25916] New: error

2020-05-03 Thread harrisbritt690.4.0 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25916

Bug ID: 25916
   Summary: error
   Product: binutils
   Version: pre-2.12
   URL: https://failfake.com/pl/
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: harrisbritt690.4.0 at gmail dot com
  Target Milestone: ---

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25917] New: segmentation fault with -gdwarf-5

2020-05-03 Thread ndesaulniers at google dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25917

Bug ID: 25917
   Summary: segmentation fault with -gdwarf-5
   Product: binutils
   Version: 2.35 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: ndesaulniers at google dot com
CC: nickc at redhat dot com
  Target Milestone: ---

With the fix from https://sourceware.org/bugzilla/show_bug.cgi?id=25612, I can
now compile a Linux kernel with Clang and assemble with GNU as with DWARF5.

Testing the same patch set with GCC 7.5+ GNU as (ToT) produces a crash in GNU
as.  I reran the kernel build with `make V=1` to get the compiler invocation,
then reran that with `-v` to get the assembler invocation.  From there, I've
trimmed it down to the following invocation and input.

$ PATH=~/binutils-gdb/binutils:$PATH as -gdwarf-5 -o scripts/mod/empty.o
/tmp/ccDA463U.s
/tmp/ccDA463U.s: Assembler messages:
/tmp/ccDA463U.s: Internal error (Segmentation fault).
Please report this bug.

$ cat /tmp/ccDA463U.s 
.section.debug_info,"",@progbits
.Ldebug_info0:
.long   0x30
.value  0x5

-- 
You are receiving this mail because:
You are on the CC list for the bug.