[Bug gas/11731] New: -msyntax=intel nasm-incompatible compilation

2010-06-20 Thread jan dot kratochvil at redhat dot com
nasm (yasm) sources commonly contain:
mov eax, dword [rbx]

nasm -f elf64 -o 2.o 1.S
   0:   8b 03   moveax,DWORD PTR [rbx]

as -msyntax=intel -mnaked-reg -o 1.o 1.S
   0:   8b 43 04moveax,DWORD PTR [rbx+0x4]

-- 
   Summary: -msyntax=intel nasm-incompatible compilation
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: jan dot kratochvil at redhat dot com
CC: bug-binutils at gnu dot org
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11731

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11732] New: internal error on invalid code && -msyntax=intel

2010-06-20 Thread jan dot kratochvil at redhat dot com
GNU assembler (GNU Binutils) 2.20.51.20100620
$ as-new -msyntax=intel -o 1 1.s
 push [foo @GOTPCREL + bar]
or
 push [...@gotpcrel + bar]

1.s: Assembler messages:
1.s:1: Internal error, aborting at symbols.c line 2168 in S_SET_SEGMENT
Please report this bug.

  if (s->bsym->flags & BSF_SECTION_SYM)
{
  if (s->bsym->section != seg)
abort ();
}
#0  S_SET_SEGMENT (s=0xd61d10, seg=0xd150e0) at symbols.c:2168
#1  in resolve_symbol_value (symp=0xd61d10) at symbols.c:1432
#2  in write_object_file () at write.c:1724
#3  in main (argc=2, argv) at as.c:1234
s->bsym->name is "*GAS `expr' section*"
s->bsym->section->name is "*GAS `expr' section*"
seg->name is "*ABS*"

-- 
   Summary: internal error on invalid code && -msyntax=intel
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: minor
  Priority: P3
 Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: jan dot kratochvil at redhat dot com
CC: bug-binutils at gnu dot org
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11732

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11731] -msyntax=intel nasm-incompatible compilation

2010-06-20 Thread hjl dot tools at gmail dot com

--- Additional Comments From hjl dot tools at gmail dot com  2010-06-21 
04:31 ---
WORD is treated as 2 and DWORD is treated as 4:

mov eax, [dword+eax]
mov eax, dword[eax]

is assembled into

   0:   8b 40 04mov0x4(%eax),%eax
   3:   8b 40 04mov0x4(%eax),%eax

It is done on purpose.

-- 
   What|Removed |Added

 CC||jbeulich at novell dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11731

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11732] internal error on invalid code && -msyntax=intel

2010-06-20 Thread hjl dot tools at gmail dot com


-- 
   What|Removed |Added

 CC||jbeulich at novell dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11732

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11733] New: Out of bounds array access prevents build.

2010-06-20 Thread forest dot belton at gmail dot com
When compiling binutils for the sh4-elf target, the following error occurs:

../../src/binutils-2.20.1/gas/config/tc-sh.c: In function 'find_cooked_opcode':
../../src/binutils-2.20.1/gas/config/tc-sh.c:2540:7: error: array subscript is 
above array bounds

Upon closer inspection, it seems to be due to the line: name[nlen] = 0;

name is declared as a char[20], and the previous for loop describes name < 20 
as 
one of the predicates.

A fix for this would involve either changing name to be a char[21] instead, or 
perhaps changing the predicate in the loop to be name < (sizeof (name) - 1). 
I'm 
not familiar enough with the binutils source to comment on which would be the 
more suitable option.

-- 
   Summary: Out of bounds array access prevents build.
   Product: binutils
   Version: 2.20
Status: NEW
  Severity: minor
  Priority: P2
 Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: forest dot belton at gmail dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: sh4-unknown-elf
  GCC host triplet: i686-pc-mingw32
GCC target triplet: sh4-unknown-elf


http://sourceware.org/bugzilla/show_bug.cgi?id=11733

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11733] Out of bounds array access prevents build.

2010-06-20 Thread forest dot belton at gmail dot com

--- Additional Comments From forest dot belton at gmail dot com  2010-06-21 
05:03 ---
Note: I'm using gcc 4.5.0 to compile binutils. I strongly suspect that this 
sort 
of check was only added recently, as I've compiled binutils for sh4-elf before 
without issue.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11733

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11731] -msyntax=intel nasm-incompatible compilation

2010-06-20 Thread jbeulich at novell dot com

--- Additional Comments From jbeulich at novell dot com  2010-06-21 06:51 
---
Actually, masm considers this a syntax error (i.e. doesn't allow dword et al not
any place a number would be accepted. Kind of confusing, but in any case not a
hint to accept this (unconditionally) the way nasm would accept it. So at best
this could be controlled by an extra command line and/or .intel_syntax option.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11731

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11731] -msyntax=intel nasm-incompatible compilation

2010-06-20 Thread jan dot kratochvil at redhat dot com

--- Additional Comments From jan dot kratochvil at redhat dot com  
2010-06-21 06:54 ---
FYI I have found this source form being used in libvpx (=VP8=WebM).
Maybe it is not commonly used elsewhere, I do not know.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11731

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/11731] -msyntax=intel nasm-incompatible compilation

2010-06-20 Thread jan dot kratochvil at redhat dot com

--- Additional Comments From jan dot kratochvil at redhat dot com  
2010-06-21 06:57 ---
A warning/error I would find OK in such case but not sure what is right to do.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11731

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils