[Bug binutils/19900] runtest fails after make

2016-04-05 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19900

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #5 from H.J. Lu  ---
Please provide ld/ld.log.

-- 
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/19872] nm and probably addr2line can't handle binaries produced with gold --incremental

2016-04-05 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19872

--- Comment #9 from Nick Clifton  ---
Hi Tristan,

> you have committed unrelated chunks (pe-dll, aarch64/simulator.c)


Argh!  Why does git do this ?  I am sure that I only "git add"ed the 
changes the bfd/ directory, so why did it add the others ?

This is really starting to piss me off.. :-(

Oh well.  Do you know how I can partially undo a commit ?

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 gas/19910] New: Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread orlandoarias at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

Bug ID: 19910
   Summary: Unsigned arithmetic and %hi()/%low() operators
   Product: binutils
   Version: 2.26
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: orlandoarias at gmail dot com
  Target Milestone: ---

Working with he sparc-leon3-linux target in gas versions 2.26.20160125
and 2.23, the following behaviour is observed:

sethi %hi(0x4000U + 0x4000U) - 160)-(8192U-160))-32U)), %fp
or %g0, %lo(0x4000U +0x4000U) - 160)-(8192U-160))-32U)), %fp

These statements fail to assemble with the error:

Error: missing ')'

However, the following assembles with no issues:

sethi %hi(0x4000 + 0x4000) - 160)-(8192-160))-32)), %fp
or %g0, %lo(0x4000 +0x4000) - 160)-(8192-160))-32)), %fp

The issue can be reduced to the following lines:

or %g0, %lo(0x4000U +0x4000U), %g1
or %g0, %lo((0x4000U +0x4000U)), %g1

The first line assembles properly, whereas the second line fails to assemble.
It looks like this is a bug with the parser. I have only tested this with the
sparc-leon3-linux target, but other targets may also be affected with the
issue. Thank you for looking into this.

Cheers,
Orlando.

-- 
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/19910] Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread orlandoarias at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

Orlando Arias  changed:

   What|Removed |Added

 CC||orlandoarias at gmail dot com

-- 
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/19908] MIPS/ELF: Hidden and internal dynamic symbols produced

2016-04-05 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=19908

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

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

commit 1f599d0e7b5039c814731293043e247304ec006b
Author: Maciej W. Rozycki 
Date:   Tue Apr 5 15:10:05 2016 +0100

ELF/LD: Avoid producing hidden and internal dynamic symbols

Always turn hidden and internal symbols which have a dynamic index into
local ones.  This is required by the the ELF gABI[1]:

"A hidden symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

"An internal symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

The ELF linker usually respects this requirement, however in the case
where a dynamic symbol has been preallocated due to a reference of the
default export class aka visibility from the object being linked, and
then merged with a hidden or internal symbol definition from within the
same object, then the original export class is carried over to the
output dynamic symbol table, because while merging the generic ELF
linker only converts affected dynamic symbols to local when they are
defined or referenced by the object being linked and a dynamic object
involved in the link both at a time.

The dynamic symbol produced confuses then the dynamic loader at the run
time -- the hidden or internal export class is ignored and the symbol
follows preemption rules as with the default export class.

In the MIPS target it happens when `mips_elf_record_global_got_symbol'
creates a dynamic symbol when a call relocation is encountered.
Additionally if the undefined symbol referred by such a relocation does
specify the intended export class, then a local dynamic symbol is
created instead, which is harmless and allowed, but useless.  Normally
no local dynamic symbols are created, except for a single dummy one at
the beginning.

Correct the problem by removing the extra check for a dynamic symbol
being defined or referenced by the object being linked and a dynamic
object involved in the link both at a time.  The test cases included
cover the internal and hidden symbol cases, as well as a protected
symbol for a reference, the handling of which is unchanged by this fix.
Both cases described above are covered, that is where an internal or
hidden dynamic symbol is produced and where a local one is.

NB this change affects CRIS results where some symbols in the static
table produced in a final link are now converted from STV_HIDDEN to
STB_LOCAL.  This happens whenever the `elf_backend_hide_symbol' handler
is called, so the affected symbols must have been chosen for entering
into the dynamic symbol table, except in these test cases no such symbol
table is produced.  In fully linked binaries the static symbol table is
only used for debugging though, so such a change is fine.

References:

[1] "System V Application Binary Interface - DRAFT - 24 April 2001",
The Santa Cruz Operation, Inc., "Symbol Table",


bfd/
PR ld/19908
* elflink.c (elf_link_add_object_symbols): Always turn hidden
and internal symbols which have a dynamic index into local
ones.

ld/
PR ld/19908
* testsuite/ld-cris/tls-e-20.d: Adjust for hidden symbol
handling fix.
* testsuite/ld-cris/tls-e-20a.d: Likewise.
* testsuite/ld-cris/tls-e-21.d: Likewise.
* testsuite/ld-cris/tls-e-23.d: Likewise.
* testsuite/ld-cris/tls-e-80.d: Likewise.
* testsuite/ld-cris/tls-gd-3h.d: Likewise.
* testsuite/ld-cris/tls-leie-19.d: Likewise.
* testsuite/ld-mips-elf/export-class-ref-lib.sd: New test.
* testsuite/ld-mips-elf/export-hidden-ref.sd: New test.
* testsuite/ld-mips-elf/export-internal-ref.sd: New test.
* testsuite/ld-mips-elf/export-protected-ref.sd: New test.
* testsuite/ld-mips-elf/export-class-ref-f0.s: New test source.
* testsuite/ld-mips-elf/export-class-ref-f1.s: New test source.
* testsuite/ld-mips-elf/export-class-ref-f2.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.

-- 
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/19908] MIPS/ELF: Hidden and internal dynamic symbols produced

2016-04-05 Thread ma...@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=19908

Maciej W. Rozycki  changed:

   What|Removed |Added

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

--- Comment #2 from Maciej W. Rozycki  ---
Fixed as per the automatically entered commit message.

-- 
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/19910] Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Hi Orlando,

  This happens because the assembler does not support U as a suffix for integer
constants.  Reduced test case:

  % cat fred.s
  sethi  %hi (((0x7FE3CU))), %fp
  sethi  %hi (((0x7FE3C))), %fp
  sethi  %hi (((0x7FE3CV))), %fp

  % as fred.s
fred.s:1: Error: missing ')'
fred.s:1: Error: missing ')'
fred.s:3: Error: missing ')'
fred.s:3: Error: missing ')'

  Obviously however the error message is bogus.  So I will look into that.

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 gas/19910] Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread orlandoarias at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

--- Comment #2 from Orlando Arias  ---
(In reply to Nick Clifton from comment #1)
Greetings:

>   This happens because the assembler does not support U as a suffix for
> integer constants.

Is there any chance that support for the suffix could be added to gas? Or is
there an already existing suffix which can be used with both GCC and GAS to the
same effect? I came across this issue when porting U-Boot for the LEON3 to run
on a Xilinx KC705 board.

The LEON3's main memory is mapped to start at 0x4000 and the KC705 board
provides 1GB of RAM. If leaving the constants as signed, computing the end of
RAM an integer overflow occurs. GCC warns of this when the constants get
expanded and non-working code is generated (U-Boot crashes on the board, have
yet to debug to find out why, likely though because of the undefined behaviour
generated by the overflow). I proceeded to add typing to the preprocessor
directives and at that point the aforementioned error came up.

>   Obviously however the error message is bogus.  So I will look into that.

This should be fine as well. I can probably make two preprocessor directives,
one to be used with the assembly sources and one to be used with the C sources.
It is less than ideal, but it could work (although I am not sure as to how GAS
would go on to handle the sum at that point).

Thank you for looking into this.

Cheers,
Orlando.

-- 
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/19910] Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

--- Comment #3 from Nick Clifton  ---
Created attachment 9154
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9154&action=edit
Proposed patch

Hi Orlando,

  Please try this patch, which should improve the error message somewhat.

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 gas/19910] Unsigned arithmetic and %hi()/%low() operators

2016-04-05 Thread orlandoarias at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19910

--- Comment #4 from Orlando Arias  ---
(In reply to Nick Clifton from comment #3)
> Created attachment 9154 [details]
> Proposed patch
> 
> Hi Orlando,
> 
>   Please try this patch, which should improve the error message somewhat.
> 
> Cheers
>   Nick

Greetings,

The patch works as expected, making the error much more clear.

$ cat assembler.S 
sethi %hi(0x4000U), %g1
or %g0, %lo(0x4000U + 0x4000U), %g1
or %g0, %lo((0x4000U + 0x4000U)), %g1

$ sparc-leon3-linux-as -c assembler.S 
assembler.S: Assembler messages:
assembler.S:3: Error: found 'U', expected: ')'

However, if U as a suffix is not supported, the assembler should catch line 2
of the testcase as invalid as well. The assembler, however, parses it
incorrectly:

$ cat assembler.S 
sethi %hi(0x4000U), %g1
or %g0, %lo(0x4000U + 0x4000U), %g1
$ sparc-leon3-linux-as -c assembler.S
$ sparc-leon3-linux-objdump -S a.out 

a.out: file format elf32-sparc


Disassembly of section .text:

 <.text>:
   0:   03 00 00 10 sethi  %hi(0x4000), %g1
   4:   82 10 20 00 clr  %g1

Manually expanding the pseudoinstruction, we see that it is actually doing:

or %g0, 0, %g1

instead of throwing an error. Naturally, the immediate constant is incorrectly
computed. Thank you for looking into this.

Cheers,
Orlando.

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