[Bug binutils/24456] bfd elf.c assertion for multiple relocations to same section

2019-09-11 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24456

--- Comment #5 from Nick Clifton  ---
Created attachment 11987
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11987&action=edit
Test binary

-- 
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/24991] the assembler generates incorrect offset for jumps on arm thumb2

2019-09-11 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

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

  Please could you upload a copy of the compiled executable *and* a copy
  of the assembler output from gcc.

  It is possible that this is a compiler bug - ie it could be generating
  a branch that is not going to the correct location - and the assembler
  output should help us determine if this is the case.  It could also be
  both a compiler and an assembler bug.  eg the compiler might be producing
  a branch that is out of range, and the assembler could be assembling it
  without complaining.

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/24991] the assembler generates incorrect offset for jumps on arm thumb2

2019-09-11 Thread mikulas at artax dot karlin.mff.cuni.cz
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

--- Comment #2 from Mikulas Patocka  
---
Created attachment 11988
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11988&action=edit
Compiler output

-- 
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/24991] the assembler generates incorrect offset for jumps on arm thumb2

2019-09-11 Thread mikulas at artax dot karlin.mff.cuni.cz
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

--- Comment #3 from Mikulas Patocka  
---
Created attachment 11989
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11989&action=edit
Assembler output

-- 
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/24991] the assembler generates incorrect offset for jumps on arm thumb2

2019-09-11 Thread mikulas at artax dot karlin.mff.cuni.cz
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

--- Comment #4 from Mikulas Patocka  
---
Created attachment 11990
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11990&action=edit
Linker output

-- 
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/24991] the assembler generates incorrect offset for jumps on arm thumb2

2019-09-11 Thread mikulas at artax dot karlin.mff.cuni.cz
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

--- Comment #5 from Mikulas Patocka  
---
I've attached the files.

It is both the compiler and assembler bug - the compiler generates out of range
jump and the assembler incorrectly assembles it as a backward jump.

-- 
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/24907] Objdump produces wrong branch opcode interpretation in some cases

2019-09-11 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24907

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 0a4632b5637fa63ea4dc7651cdbae21e8b7005cd
Author: Alan Modra 
Date:   Wed Sep 11 17:33:00 2019 +0930

Re: Enhance the disassembler

PR 24907
* objdump.c (disassemble_bytes): Adjust code to avoid overlong
lines.  Correct max_reloc_offset_into_insn test.

-- 
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/24992] New: RISC-V: partial relaxing against global pointer with sdata section alignment

2019-09-11 Thread yitingwang16 at outlook dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24992

Bug ID: 24992
   Summary: RISC-V: partial relaxing against global pointer with
sdata section alignment
   Product: binutils
   Version: 2.30
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: yitingwang16 at outlook dot com
  Target Milestone: ---

A simple test case below to trigger the weird behavior of GP linker relaxation:
$ cat test.c
char __attribute__ ((aligned(2))) x = 'x';
char a = 1;
char b = 2;
char c = 3;
char d = 4;
char e = 5;

int main()
{
return a + b + c + d + e;
}

$ riscv64-unknown-linux-gnu-gcc -nostdlib -o test test.c

HI20/LO12 relocations that reference c, d and e are relaxed against gp:
$ riscv64-unknown-linux-gnu-objdump -D test

000100e8 :
   100e8:   1141addisp,sp,-16
   100ea:   e422sd  s0,8(sp)
   100ec:   0800addis0,sp,16
   100ee:   67c5lui a5,0x11
   100f0:   1317c783lbu a5,305(a5) # 11131 
   100f4:   0007871bsext.w  a4,a5
   100f8:   67c5lui a5,0x11
   100fa:   1327c783lbu a5,306(a5) # 11132 
   100fe:   2781sext.w  a5,a5
   10100:   9fb9addwa5,a5,a4
   10102:   0007871bsext.w  a4,a5
   10106:   8031c783lbu a5,-2045(gp) # 11133 
   1010a:   2781sext.w  a5,a5
   1010c:   9fb9addwa5,a5,a4
   1010e:   0007871bsext.w  a4,a5
   10112:   8041c783lbu a5,-2044(gp) # 11134 
   10116:   2781sext.w  a5,a5
   10118:   9fb9addwa5,a5,a4
   1011a:   0007871bsext.w  a4,a5
   1011e:   8051c783lbu a5,-2043(gp) # 11135 
   10122:   2781sext.w  a5,a5
   10124:   9fb9addwa5,a5,a4
   10126:   2781sext.w  a5,a5
   10128:   853emv  a0,a5
   1012a:   6422ld  s0,8(sp)
   1012c:   0141addisp,sp,16
   1012e:   8082ret

Change test.c line#1 to:
char __attribute__ ((aligned(4))) x = 'x';

Only HI20/LO12 relocation that references e is relaxed against gp:
$ riscv64-unknown-linux-gnu-objdump -D test
000100e8 :
   100e8:   1141addisp,sp,-16
   100ea:   e422sd  s0,8(sp)
   100ec:   0800addis0,sp,16
   100ee:   67c5lui a5,0x11
   100f0:   1357c783lbu a5,309(a5) # 11135 
   100f4:   0007871bsext.w  a4,a5
   100f8:   67c5lui a5,0x11
   100fa:   1367c783lbu a5,310(a5) # 11136 
   100fe:   2781sext.w  a5,a5
   10100:   9fb9addwa5,a5,a4
   10102:   0007871bsext.w  a4,a5
   10106:   67c5lui a5,0x11
   10108:   1377c783lbu a5,311(a5) # 11137 
   1010c:   2781sext.w  a5,a5
   1010e:   9fb9addwa5,a5,a4
   10110:   0007871bsext.w  a4,a5
   10114:   67c5lui a5,0x11
   10116:   1387c783lbu a5,312(a5) # 11138 
   1011a:   2781sext.w  a5,a5
   1011c:   9fb9addwa5,a5,a4
   1011e:   0007871bsext.w  a4,a5
   10122:   8051c783lbu a5,-2043(gp) # 11139 
   10126:   2781sext.w  a5,a5
   10128:   9fb9addwa5,a5,a4
   1012a:   2781sext.w  a5,a5
   1012c:   853emv  a0,a5
   1012e:   6422ld  s0,8(sp)
   10130:   0141addisp,sp,16
   10132:   8082ret

Change test.c line#1 to:
char __attribute__ ((aligned(8))) x = 'x';

Then there is no relaxation against gp.

-- 
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/24993] New: RISC-V: Address 0x00000000000xxxxx is out of bounds when "objdump -D"

2019-09-11 Thread yitingwang16 at outlook dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24993

Bug ID: 24993
   Summary: RISC-V: Address 0x000x is out of bounds
when "objdump -D"
   Product: binutils
   Version: 2.30
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: yitingwang16 at outlook dot com
  Target Milestone: ---

$ cat test.c
char __attribute__ ((aligned(2))) x = 'x';
char a = 1;
char b = 2;
char c = 3;
char d = 4;
char e = 5;

int main()
{
return a + b + c + d + e;
}

$ riscv64-unknown-linux-gnu-gcc -nostdlib -o test test.c

$ riscv64-unknown-linux-gnu-objdump -D test
...
Disassembly of section .sdata:

00011130 :
   11130:   addia4,sp,140

00011131 :
   11131:   additp,tp,0

00011132 :
   11132:   sllit1,t1,0x0

00011133 :
   11133:   lb  s0,0(zero) # 0 

00011134 :
   11134:   addis1,sp,640

00011135 :
   11135:   05  Address 0x00011135 is out of bounds.

   11139:

-- 
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/24992] RISC-V: partial relaxing against global pointer with sdata section alignment

2019-09-11 Thread wilson at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24992

Jim Wilson  changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #1 from Jim Wilson  ---
This is essentially a dup of 24983.

-- 
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/24993] RISC-V: Address 0x00000000000xxxxx is out of bounds when "objdump -D"

2019-09-11 Thread wilson at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24993

Jim Wilson  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||wilson at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #1 from Jim Wilson  ---
the problem is that you are using objdump -D, and this is almost always the
wrong thing to do.  The correct option is "-d".

-D will dump data sections as if they are text sections, but data sections are
not text, and thus (normally) all you will get is garbage.  There is also the
problem that risc-v instructions require nature alignment and power of 2 sizes,
and data does not.

So in this case, you have an odd number of bytes in the data section, which
can't be translated into a RISC-V instruction, and so you are getting an
objdump error, which is correct.  The error message could perhaps be a little
friendlier, but the error is correct.

I think there is some old RISC-V docs somewhere telling people to use objdump
-D when they should not be using it, as there is an epidemic of RISC-V folks
reporting bugs with objdump -D when it isn't broken, and when they shouldn't
have used -D in the first place.

If you are aware of docs someplace recommending people use objdump -D, then
please report bugs against those docs, not against 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 ld/24983] RISC-V GP linker relaxation is not performed with -nostdlib

2019-09-11 Thread wilson at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24983

Jim Wilson  changed:

   What|Removed |Added

 CC||yitingwang16 at outlook dot com

--- Comment #2 from Jim Wilson  ---
*** Bug 24992 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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/24992] RISC-V: partial relaxing against global pointer with sdata section alignment

2019-09-11 Thread wilson at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24992

Jim Wilson  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Jim Wilson  ---
Same problem as 24983.

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

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