[Bug gold/23409] New: Shared libraries created with duplicate _end, _edata and __bss_start symbols

2018-07-12 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23409

Bug ID: 23409
   Summary: Shared libraries created with duplicate _end, _edata
and __bss_start symbols
   Product: binutils
   Version: 2.30
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: amodra at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

cat > end1.ver << EOF
VER1 {
  global: *;
};
EOF
cat > end2.ver << EOF
VER2 {
  global: *;
};
EOF
as -o dummy.o < /dev/null
ld.gold -shared -o lib2.so dummy.o --version-script end2.ver
ld.gold -shared -o lib1.so dummy.o lib2.so --version-script end1.ver

readelf --dyn-syms lib2.so 

Symbol table '.dynsym' contains 5 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND 
 1: 2000 0 NOTYPE  GLOBAL DEFAULT8 _end@@VER2
 2: 2000 0 NOTYPE  GLOBAL DEFAULT8 _edata@@VER2
 3: 2000 0 NOTYPE  GLOBAL DEFAULT8 __bss_start@@VER2
 4:  0 OBJECT  GLOBAL DEFAULT  ABS VER2

readelf --dyn-syms lib1.so

Symbol table '.dynsym' contains 8 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND 
 1: 2000 0 NOTYPE  GLOBAL DEFAULT8 _end@VER1
 2: 2000 0 NOTYPE  GLOBAL DEFAULT8 _edata@VER1
 3: 2000 0 NOTYPE  GLOBAL DEFAULT8 _edata@@VER1
 4: 2000 0 NOTYPE  GLOBAL DEFAULT8 _end@@VER1
 5:  0 OBJECT  GLOBAL DEFAULT  ABS VER1
 6: 2000 0 NOTYPE  GLOBAL DEFAULT8 __bss_start@VER1
 7: 2000 0 NOTYPE  GLOBAL DEFAULT8 __bss_start@@VER1

Why are both _end@VER1 and _end@@VER1 present in lib1.so?

See https://bugzilla.redhat.com/show_bug.cgi?id=1600035

-- 
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/23405] Some inputs may cause objcopy to crash, without being detected by error checking or assertions

2018-07-12 Thread zhanggen12 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23405

zhanggen12 at hotmail dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|WORKSFORME  |---

--- Comment #2 from zhanggen12 at hotmail dot com ---
(In reply to Alan Modra from comment #1)
> Seems to already be fixed with 2.31 or master binutils

The stack trace is as follows from gdb:

#0  aout_32_swap_std_reloc_out (abfd=abfd@entry=0x7482f0, g=0x74a730,
natptr=natptr@entry=0x748658)
at aoutx.h:1971
#1  0x0048980f in aout_32_squirt_out_relocs (abfd=abfd@entry=0x7482f0,
section=)
at aoutx.h:2444
#2  0x004840a1 in i386linux_write_object_contents (abfd=0x7482f0) at
i386linux.c:77
#3  0x0043066a in bfd_close (abfd=0x7482f0) at opncls.c:731
#4  0x0040bd36 in copy_file (
input_filename=input_filename@entry=0x7fffe284
"./crashes/id:24,sig:11,src:002665,op:flip1,pos:52",
output_filename=output_filename@entry=0x7fffe2ba "a.elf",
input_target=input_target@entry=0x0, output_target=,
output_target@entry=0x0,
input_arch=input_arch@entry=0x0) at objcopy.c:3530
#5  0x00404924 in copy_main (argv=, argc=) at objcopy.c:5478
#6  main (argc=3, argv=0x7fffdef8) at objcopy.c:5582

So the crash happens in aoutx.h, a header file in Binary File Descriptor
library.

-- 
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/16177] R_ARM_COPY reloc generated for reference in writable section

2018-07-12 Thread jrtc27 at jrtc27 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16177

James Clarke  changed:

   What|Removed |Added

 CC||jrtc27 at jrtc27 dot com

--- Comment #9 from James Clarke  ---
Created attachment 11124
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11124=edit
Updated/fixed patch

The original patch on this bug report looks at whether the symbol in question
is in a read-only section, but that should have no effect on whether this
symbol needs to be copied into the executable. Instead, it should be checking
whether there are any relocations in read-only sections referring to the
symbol, as that determines whether we are able to leave in dynamic relocations.
Ben's rebased version also has the issue of messing with the SEC_READONLY check
currently present; that should stay, as SEC_READONLY determines where the
copied symbol should go, but only matters if we are doing a copy in the first
place. This patch hasn't even been compile tested, but I'm 90% confident it
works!

-- 
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/14187] gold incorrectly requires hexadecimals to start with 0x with -Ttext/-Tdata/-Tbss

2018-07-12 Thread devurandom at gmx dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=14187

Dennis Schridde  changed:

   What|Removed |Added

 CC||devurandom at gmx dot net

-- 
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/17550] Section groups (comdat/linkonce) create undefined symbols unnecessarily

2018-07-12 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=17550

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_31-branch branch has been updated by Alan Modra
:

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

commit ae0e76dcfcb7a8d2d8b5cbd7fcb976b5825534fb
Author: Alan Modra 
Date:   Tue Jul 3 12:18:10 2018 +0930

Hide dynamic symbols in discarded sections

This is a followup to git commit 97196564c7 "Strip global symbol
defined in discarded section".  If a symbol defined in a discarded
section was dynamic, that patch left .dynsym with holes (ie. all zero
entries).  For example, the following from libstdc++.so:

Symbol table '.dynsym' contains 6090 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1: 000a74e0 0 SECTION LOCAL  DEFAULT   10
 2: 00264180 0 SECTION LOCAL  DEFAULT   17
 3:  0 NOTYPE  WEAK   DEFAULT  UND
_ITM_addUserCommitAction
 4:  0 NOTYPE  WEAK   DEFAULT  UND _ITM_memcpyRtWn
 5:  0 NOTYPE  LOCAL  DEFAULT  UND
readelf: Warning: local symbol 5 found at index >= .dynsym's sh_info value
of 3
 6:  0 NOTYPE  LOCAL  DEFAULT  UND
readelf: Warning: local symbol 6 found at index >= .dynsym's sh_info value
of 3
[snip]

This patch removes the symbols from .dynsym too.

PR 17550
* elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
in discarded sections.

(cherry picked from commit af0bfb9c4283ce80fe37ad6360d12cae8ec38696)

-- 
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/23405] Some inputs may cause objcopy to crash, without being detected by error checking or assertions

2018-07-12 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23405

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||amodra at gmail dot com
 Resolution|--- |WORKSFORME
   Severity|critical|normal

--- Comment #1 from Alan Modra  ---
Seems to already be fixed with 2.31 or master binutils

-- 
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/23405] Some inputs may cause objcopy to crash, without being detected by error checking or assertions

2018-07-12 Thread zhanggen12 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23405

zhanggen12 at hotmail dot com changed:

   What|Removed |Added

   Severity|normal  |critical

-- 
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/23405] New: Some inputs may cause objcopy to crash, without being detected by error checking or assertions

2018-07-12 Thread zhanggen12 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23405

Bug ID: 23405
   Summary: Some inputs may cause objcopy to crash, without being
detected by error checking or assertions
   Product: binutils
   Version: 2.30
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: zhanggen12 at hotmail dot com
  Target Milestone: ---

Created attachment 11123
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11123=edit
crash input

http://git.hunter-ht.cn/zhanggen/objcopy_crash_input_1
please download the latest version of objcopy and the crash input file.
COMMAND LINE: ./objcopy crash\ input a.elf
Then you will see the segmentation fault

-- 
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/23192] aarch64: indexed fcmla doesn't support all registers

2018-07-12 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23192

--- Comment #6 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_31-branch branch has been updated by Tamar Christina
:

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

commit 3b5e60a4e09242c30ee909175588a47fcae7f464
Author: Tamar Christina 
Date:   Thu Jul 12 10:28:46 2018 +0100

Add remainder of Em16 restrictions for AArch64 gas.

This adds the missing Em16 constraints the rest of the instructions
requiring them
and also adds a testcase to test all the instructions so these are checked
from
now on.

The Em16 operand constrains the valid registers to the lower 16 registers
when used
with a half precision qualifier.

The list has been cross checked (by hand) through the Arm ARM version Ca.

opcodes/

PR binutils/23192
* aarch64-tbl.h (sqdmlal, sqdmlal2, smlsl, smlsl2, sqdmlsl, sqdmlsl2,
mul, smull, smull2, sqdmull, sqdmull2, sqdmulh, sqrdmulh, mla, umlal,
umlal2, mls, umlsl, umlsl2, umull, umull2, sqdmlal, sqdmlsl, sqdmull,
sqdmulh, sqrdmulh): Use Em16.

gas/

PR binutils/23192
* testsuite/gas/aarch64/illegal-by-element.s: New.
* testsuite/gas/aarch64/illegal-by-element.d: New.
* testsuite/gas/aarch64/illegal-by-element.l: New.

(cherry picked from commit 45a28947f3fe5693560e9a1d6373807a9e82c04a)
Signed-off-by: Tamar Christina 

-- 
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/23192] aarch64: indexed fcmla doesn't support all registers

2018-07-12 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23192

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

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

commit 45a28947f3fe5693560e9a1d6373807a9e82c04a
Author: Tamar Christina 
Date:   Thu Jul 12 10:28:46 2018 +0100

Add remainder of Em16 restrictions for AArch64 gas.

This adds the missing Em16 constraints the rest of the instructions
requiring them
and also adds a testcase to test all the instructions so these are checked
from
now on.

The Em16 operand constrains the valid registers to the lower 16 registers
when used
with a half precision qualifier.

The list has been cross checked (by hand) through the Arm ARM version Ca.

opcodes/

PR binutils/23192
* aarch64-tbl.h (sqdmlal, sqdmlal2, smlsl, smlsl2, sqdmlsl, sqdmlsl2,
mul, smull, smull2, sqdmull, sqdmull2, sqdmulh, sqrdmulh, mla, umlal,
umlal2, mls, umlsl, umlsl2, umull, umull2, sqdmlal, sqdmlsl, sqdmull,
sqdmulh, sqrdmulh): Use Em16.

gas/

PR binutils/23192
* testsuite/gas/aarch64/illegal-by-element.s: New.
* testsuite/gas/aarch64/illegal-by-element.d: New.
* testsuite/gas/aarch64/illegal-by-element.l: New.

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