[Bug binutils/25355] nm reports data variable as "T" with -flto

2020-02-10 Thread marxin.liska at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

--- Comment #15 from Martin Liška  ---
Thank you H.J. I can confirm the patch works:

Before:

$ cat x.c
int nm_test_var;
int nm_test_var2 = 1234;

extern int foo (void);

int
main ()
{
  return foo ();
}

$ gcc-9 -fno-common x.c -c -flto && nm x.o
 U foo
 T main
 T nm_test_var
 T nm_test_var2

After:
$ ~/bin/binutils/bin/nm --plugin
/usr/bin/../bin/../lib/bfd-plugins/liblto_plugin.so.0.0.0 x.o
 U foo
 T main
 B nm_test_var
 D nm_test_var2

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


[Bug binutils/25526] New: [readelf] segmentation fault crash with -a -D flag

2020-02-10 Thread dkcjd2000 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25526

Bug ID: 25526
   Summary: [readelf] segmentation fault crash with -a -D flag
   Product: binutils
   Version: 2.34
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dkcjd2000 at gmail dot com
  Target Milestone: ---

Created attachment 12279
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12279&action=edit
crash test case

readelf crashes with the following command:
./readelf -a -D 
It crashes at process_relocs readelf.c:7316.

Program received signal SIGSEGV, Segmentation fault.
0x77a5bcc0 in _IO_vfprintf_internal (s=0x77dd2620
<_IO_2_1_stdout_>, format=, ap=ap@entry=0x7fffdcd8) at
vfprintf.c:1632
1632vfprintf.c: No such file or directory.
(gdb) bt
#0  0x77a5bcc0 in _IO_vfprintf_internal (s=0x77dd2620
<_IO_2_1_stdout_>, format=, ap=ap@entry=0x7fffdcd8)
at vfprintf.c:1632
#1  0x77b239ef in ___printf_chk (flag=flag@entry=1, format=) at printf_chk.c:35
#2  0x0042cd96 in printf (__fmt=) at
/usr/include/x86_64-linux-gnu/bits/stdio2.h:104
#3  dump_ia64_vms_dynamic_fixups (strtab_sz=134512692, strtab=0x0,
fixup=0x7fffde40, filedata=0x6c) at readelf.c:7104
#4  process_ia64_vms_dynamic_relocs (filedata=0x6c) at readelf.c:7219
#5  process_relocs (filedata=0x6c) at readelf.c:7316
#6  process_object (filedata=filedata@entry=0x6c) at readelf.c:19966
#7  0x004034fd in process_file (file_name=) at
readelf.c:20416
#8  main (argc=4, argv=0x7fffe148) at readelf.c:20475

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


[Bug ld/25527] New: [RISC-V] -static-pie not producing relocations

2020-02-10 Thread xerpi.g.12 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25527

Bug ID: 25527
   Summary: [RISC-V] -static-pie not producing relocations
   Product: binutils
   Version: 2.32
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: xerpi.g.12 at gmail dot com
  Target Milestone: ---

Trying to compile with -static-pie for a bare-metal target: no dynamic linker
and therefore the relocations have to be resolved by the ELF loader when it
establishes a load address or the executable itself at init by iterating over
the relocatable sections.
The problem is that after linking, the output ELF doesn't contain relocations.
Also attached the output when compiling for aarch64.

$ cat simple.c
typedef void (*fptr)(void);

void func1(void) {}
void func2(void) {}

const fptr table[] = {
func1,
func2,
};

int _start(int i)
{
table[i]();
}

$ cat linker.ld
ENTRY(_start)

SECTIONS
{
. = 0x1000;
}

---
RISC-V:
- GCC: riscv64-unknown-elf-gcc (GCC) 9.2.0
- binutils: GNU ld (GNU Binutils) 2.32

$ riscv64-unknown-elf-gcc -fPIE -c simple.c -o simple.riscv.o
$ riscv64-unknown-elf-readelf -r simple.riscv.o

Relocation section '.rela.text' at offset 0x278 contains 4 entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
0050  000b0017 R_RISCV_PCREL_HI2  table + 0
0050  0033 R_RISCV_RELAX0
0054  00060018 R_RISCV_PCREL_LO1 0050 .L0  + 0
0054  0033 R_RISCV_RELAX0

Relocation section '.rela.data.rel.ro.local' at offset 0x2d8 contains 2
entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
  00090002 R_RISCV_64 func1 + 0
0008  000a0002 R_RISCV_64001c func2 + 0

$ riscv64-unknown-elf-gcc -nostdlib -nostartfiles -T linker.ld -static-pie
simple.riscv.o -o simple.riscv.elf
$ riscv64-unknown-elf-readelf -r simple.riscv.elf

There are no relocations in this file.

simple.riscv.elf is "Type: EXEC (Executable file)"

---
aarch64:
- GCC: aarch64-linux-gcc.br_real (Buildroot 2018.11-rc2-3-ga0787e9) 8.2.0
- binutils: GNU ld (GNU Binutils) 2.31.1

$ aarch64-linux-gcc -fPIE -c simple.c -o simple.aarch64.o
$ aarch64-linux-readelf -r simple.aarch64.o 

Relocation section '.rela.text' at offset 0x2d8 contains 2 entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
001c  000e0113 R_AARCH64_ADR_PRE  table + 0
0020  000e0115 R_AARCH64_ADD_ABS  table + 0

Relocation section '.rela.data.rel.ro.local' at offset 0x308 contains 2
entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
  000c0101 R_AARCH64_ABS64    func1 + 0
0008  000d0101 R_AARCH64_ABS64   0008 func2 + 0

Relocation section '.rela.eh_frame' at offset 0x338 contains 3 entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
001c  00020105 R_AARCH64_PREL32   .text + 0
0030  00020105 R_AARCH64_PREL32   .text + 8
0044  00020105 R_AARCH64_PREL32   .text + 10

$ aarch64-linux-gcc -nostdlib -nostartfiles -T linker.ld -static-pie
simple.aarch64.o -o simple.aarch64.elf
$ aarch64-linux-readelf -r simple.aarch64.elf 

Relocation section '.rela.dyn' at offset 0x1148 contains 2 entries:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
1178  0403 R_AARCH64_RELATIV1000
1180  0403 R_AARCH64_RELATIV1008

simple.aarch64.elf is "Type: DYN (Shared object file)"

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


[Bug binutils/25355] nm reports data variable as "T" with -flto

2020-02-10 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

H.J. Lu  changed:

   What|Removed |Added

URL||https://sourceware.org/ml/b
   ||inutils/2020-02/msg00144.ht
   ||ml
Version|unspecified |2.35 (HEAD)
   Target Milestone|--- |2.35

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

https://sourceware.org/ml/binutils/2020-02/msg00144.html

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


[Bug binutils/25355] nm reports data variable as "T" with -flto

2020-02-10 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

H.J. Lu  changed:

   What|Removed |Added

  Attachment #12277|0   |1
is obsolete||

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


[Bug gas/25516] gas no longer accepts sysenter/sysexit with no -m flag.

2020-02-10 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25516

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 4b5aaf5f6992319c2c72e080a1a55842640b8732
Author: H.J. Lu 
Date:   Mon Feb 10 08:37:22 2020 -0800

x86: Accept Intel64 only instruction by default

Commit d835a58baae720 disabled sysenter/sysenter in 64-bit mode by
default.  By default, assembler should accept common, Intel64 only
and AMD64 ISAs since there are no conflicts.

gas/

PR gas/25516
* config/tc-i386.c (intel64): Renamed to ...
(isa64): This.
(match_template): Accept Intel64 only instruction by default.
(i386_displacement): Updated.
(md_parse_option): Updated.
* c-i386.texi: Update -mamd64/-mintel64 documentation.
* testsuite/gas/i386/i386.exp: Run x86-64-sysenter.  Pass
-mamd64 to x86-64-sysenter-amd.
* testsuite/gas/i386/x86-64-sysenter.d: New file.

opcodes/

PR gas/25516
* i386-gen.c (opcode_modifiers): Replace AMD64 and Intel64
with ISA64.
* i386-opc.h (AMD64): Removed.
(Intel64): Likewose.
(AMD64): New.
(INTEL64): Likewise.
(INTEL64ONLY): Likewise.
(i386_opcode_modifier): Replace amd64 and intel64 with isa64.
* i386-opc.tbl (Amd64): New.
(Intel64): Likewise.
(Intel64Only): Likewise.
Replace AMD64 with Amd64.  Update sysenter/sysenter with
Cpu64 and Intel64Only.  Remove AMD64 from sysenter/sysenter.
* i386-tbl.h: Regenerated.

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


[Bug gas/25516] gas no longer accepts sysenter/sysexit with no -m flag.

2020-02-10 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25516

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_34-branch branch has been updated by H.J. Lu
:

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

commit 924adcb1d4836a08b254404350220b67332e7647
Author: H.J. Lu 
Date:   Mon Feb 10 08:37:22 2020 -0800

x86: Accept Intel64 only instruction by default

Commit d835a58baae720 disabled sysenter/sysenter in 64-bit mode by
default.  By default, assembler should accept common, Intel64 only
and AMD64 ISAs since there are no conflicts.

gas/

PR gas/25516
* config/tc-i386.c (intel64): Renamed to ...
(isa64): This.
(match_template): Accept Intel64 only instruction by default.
(i386_displacement): Updated.
(md_parse_option): Updated.
* c-i386.texi: Update -mamd64/-mintel64 documentation.
* testsuite/gas/i386/i386.exp: Run x86-64-sysenter.  Pass
-mamd64 to x86-64-sysenter-amd.
* testsuite/gas/i386/x86-64-sysenter.d: New file.

opcodes/

PR gas/25516
* i386-gen.c (opcode_modifiers): Replace AMD64 and Intel64
with ISA64.
* i386-opc.h (AMD64): Removed.
(Intel64): Likewose.
(AMD64): New.
(INTEL64): Likewise.
(INTEL64ONLY): Likewise.
(i386_opcode_modifier): Replace amd64 and intel64 with isa64.
* i386-opc.tbl (Amd64): New.
(Intel64): Likewise.
(Intel64Only): Likewise.
Replace AMD64 with Amd64.  Update sysenter/sysenter with
Cpu64 and Intel64Only.  Remove AMD64 from sysenter/sysenter.
* i386-tbl.h: Regenerated.

(cherry picked from commit 4b5aaf5f6992319c2c72e080a1a55842640b8732)

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


[Bug gas/25516] gas no longer accepts sysenter/sysexit with no -m flag.

2020-02-10 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25516

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.35

--- Comment #5 from H.J. Lu  ---
Fixed for 2.35 and 2.34 branch.

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


Issue 19992 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in nds32_parse_opcode

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 19992 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in nds32_parse_opcode
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19992#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20007 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in is_function_entry

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20007 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in is_function_entry
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20007#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20000 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in immediate

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 2 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in immediate
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20019 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in msp430_singleoperand

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20019 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in msp430_singleoperand
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20019#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20018 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in print_insn_arg

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20018 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in print_insn_arg
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20018#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19981 in oss-fuzz: binutils:fuzz_disassemble: Integer-overflow in parse_insn_tilepro

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 19981 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Integer-overflow in parse_insn_tilepro
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19981#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19918 in oss-fuzz: binutils:fuzz_disassemble: Undefined-shift in disassemble

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 19918 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Undefined-shift in disassemble
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19918#c3

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20002 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in compare_opcodes

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20002 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in compare_opcodes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20002#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19911 in oss-fuzz: binutils:fuzz_disassemble: Undefined-shift in print_insn_spu

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 19911 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Undefined-shift in print_insn_spu
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19911#c3

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19998 in oss-fuzz: binutils:fuzz_bfd: Unsigned-integer-overflow in _bfd_xcoff_slurp_armap

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 19998 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_bfd: 
Unsigned-integer-overflow in _bfd_xcoff_slurp_armap
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19998#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20012 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in mips_decode_int_operand

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20012 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in mips_decode_int_operand
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20012#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20016 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in print_insn_sh

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20016 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in print_insn_sh
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20016#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20006 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in hash_keyword_name

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20006 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in hash_keyword_name
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20006#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20020 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in fmtconst

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20020 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in fmtconst
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20020#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19997 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in extract_fields

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 19997 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in extract_fields
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19997#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19993 in oss-fuzz: binutils:fuzz_bfd: Unsigned-integer-overflow in bfd_seek

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 19993 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_bfd: 
Unsigned-integer-overflow in bfd_seek
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19993#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20011 in oss-fuzz: binutils:fuzz_disassemble: Unsigned-integer-overflow in xstormy16_cgen_extract_operand

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20011 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Unsigned-integer-overflow in xstormy16_cgen_extract_operand
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20011#c2

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19755 in oss-fuzz: binutils:fuzz_disassemble: Undefined-shift in print_insn_score48

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 19755 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Undefined-shift in print_insn_score48
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19755#c3

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 19679 in oss-fuzz: binutils:fuzz_disassemble: Undefined-shift in iqNUMBER_cgen_extract_operand

2020-02-10 Thread sheriff… via monorail
Updates:
Labels: -restrict-view-commit

Comment #7 on issue 19679 by 
sheriff...@sheriffbot-1182.iam.gserviceaccount.com: binutils:fuzz_disassemble: 
Undefined-shift in iqNUMBER_cgen_extract_operand
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19679#c7

This bug has been fixed for 30 days. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

[Bug ld/25527] [RISC-V] -static-pie not producing relocations

2020-02-10 Thread wilson at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25527

Jim Wilson  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-02-11
 CC||wilson at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jim Wilson  ---
I see two problems here.

The first problem is that the RISC-V GCC port isn't handling the --static-pie
option.  For targets that support it, --static-pie should be translated to the
linker options "--static --pie --no-dynamic-linker -z text".  This doesn't
happen for RISC-V as the gcc support is missing.

The second problem is that if I manually specify the missing linker options
then I get a linker error "-pie is not supported".  We do not have support for
shared libraries in our embedded toolchain because no one has done a RISC-V
shared library port of newlib yet.  I get binutils testsuite errors if I enable
shared library support, which makes it harder to spot testsuite regressions. 
Also, I used to get bug reports from users asking why the shared library
support was broken because they couldn't get it working.  It isn't broken, it
is because the newlib support is missing.

If I use a linux toolchain, and manually specify the missing linker options,
then it works correctly.  But the linux toolchain isn't designed for bare metal
targets so that probably isn't usable as a workaround.

The GCC bug should be fixed and looks easy enough.

You could hack around the binutils problem by reverting the patch that disabled
shared library support in the embedded elf toolchain.  Or maybe I should
consider re-enabling the support and find some other way to handle the newlib
and testsuite problems.  You don't need shared libraries to make static pie
work.  And the boot loader folks would also like to be able to use static pie
or something similar.

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


[Bug binutils/25355] nm reports data variable as "T" with -flto

2020-02-10 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

--- Comment #17 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 0aa99dcd70bce68f8efef310350a6294e1143382
Author: H.J. Lu 
Date:   Mon Feb 10 19:01:42 2020 -0800

Use GCC LTO wrapper to get real symbols from LTO IR objects

GCC LTO wrapper is needed to extract real symbols from LTO IR objects.
This patch does the following:

1. Set up GCC LTO wrapper for each LTO IR object.
2. Run GCC LTO wrapper to get the real object.
3. Extract symbol info from the real object.
4. Cleanup afterwards.

bfd/

PR binutils/25355
* configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
(EXECUTABLE_SUFFIX): Likewise.
* config.in: Regenerated.
* configure: Likewise.
* plugin.c (bfd_plugin_close_and_cleanup): Removed.
(plugin_list_entry): Add all_symbols_read, cleanup_handler,
gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
(get_lto_wrapper): New.
(setup_lto_wrapper_env): Likewise.
(current_plugin): Likewise.
(register_all_symbols_read): Likewise.
(register_cleanup): Likewise.
(get_symbols): Likewise.
(add_input_file): Likewise.
(bfd_plugin_close_and_cleanup): Likewise.
(claim_file): Removed.
(register_claim_file): Set current_plugin->claim_file.
(add_symbols): Make a copy of LTO symbols.  Set lto_nsyms and
lto_syms in current_plugin.
(try_claim): Use current_plugin->claim_file.  Call LTO plugin
all_symbols_read handler.  Copy real symbols to plugin_data.
Call LTO plugin cleanup handler.  Clean up for LTO wrapper.
(try_load_plugin): Don't reuse the previous plugin for LTO
wrapper.  Set up GCC LTO wrapper if possible.  Don't set
plugin_list_iter->claim_file.
(bfd_plugin_canonicalize_symtab): Use real LTO symbols if
possible.
* plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
real_syms.

ld/

PR binutils/25355
* testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test.
* testsuite/ld-plugin/pr25355.c: New file.
* testsuite/ld-plugin/pr25355.d: Likewise.
* testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile
only dump.

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


[Bug binutils/25355] nm reports data variable as "T" with -flto

2020-02-10 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #18 from H.J. Lu  ---
Fixed for 2.35.

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


Issue 20598 in oss-fuzz

2020-02-10 Thread amo… via monorail
The following issue was updated:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20598#c2
-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20600 in oss-fuzz

2020-02-10 Thread amo… via monorail
The following issue was updated:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20600#c2
-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20607 in oss-fuzz

2020-02-10 Thread amo… via monorail
The following issue was updated:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20607#c2
-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 20602 in oss-fuzz

2020-02-10 Thread amo… via monorail
The following issue was updated:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20602#c2
-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

[Bug binutils/25529] New: [objdump] binutils 2.34 free(): invalid pointer with -x flag

2020-02-10 Thread law4dmail at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25529

Bug ID: 25529
   Summary: [objdump] binutils 2.34 free(): invalid pointer with
-x flag
   Product: binutils
   Version: 2.34
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: law4dmail at gmail dot com
  Target Milestone: ---

Created attachment 12280
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12280&action=edit
crash test case

objdump crashes with the following command:
./objdump -x 


=
==20906==ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed: 0x61e0f4e0 in thread T0
#0 0x7fa02645a2ca in __interceptor_free
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)
#1 0x958046 in _bfd_coff_free_symbols
/home/ubuntu/xxx/sources/binutils-2.34/bfd/coffgen.c:1782
#2 0x958046 in _bfd_coff_close_and_cleanup
/home/ubuntu/xxx/sources/binutils-2.34/bfd/coffgen.c:3180
#3 0x637038 in bfd_close_all_done
/home/ubuntu/xxx/sources/binutils-2.34/bfd/opncls.c:789
#4 0x41165e in display_file objdump.c:5016
#5 0x41165e in main objdump.c:5349
#6 0x7fa025e1482f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#7 0x4153b8 in _start
(/home/ubuntu/xxx/proven/binutils/bin/objdump+0x4153b8)

0x61e0f4e0 is located 1120 bytes inside of 2541-byte region
[0x61e0f080,0x61e0fa6d)
allocated by thread T0 here:
#0 0x7fa02645a79a in __interceptor_calloc
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a)
#1 0x62963a in bfd_malloc
/home/ubuntu/xxx/sources/binutils-2.34/bfd/libbfd.c:275
#2 0x62963a in bfd_zmalloc
/home/ubuntu/xxx/sources/binutils-2.34/bfd/libbfd.c:360

SUMMARY: AddressSanitizer: bad-free ??:0 __interceptor_free
==20906==ABORTING

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


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

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

Alan Modra  changed:

   What|Removed |Added

 CC||law4dmail at gmail dot com

--- Comment #4 from Alan Modra  ---
*** Bug 25529 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/25529] [objdump] binutils 2.34 free(): invalid pointer with -x flag

2020-02-10 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25529

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #1 from Alan Modra  ---
Already fixed.

*** 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.