[Bug ld/13666] New: gold-linked binary for ppc results in program-termination with illegal instruction

2012-02-06 Thread stormtroopa at gmx dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=13666

 Bug #: 13666
   Summary: gold-linked binary for ppc results in
program-termination with illegal instruction
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: stormtro...@gmx.net
Classification: Unclassified


I am using gold v1.11 (binutils v2.2) for cross-linking a program for my
powerpc architecture (P2020 CPU).
When I execute this binary I am getting an Illegal instruction.
Readelf delivers a correct fileheader (Machine: PowerPC).

Linking with the standard GNU ld creates a runnable binary, but of course needs
a lot longer.

I compiled gold before for arm. Worked like a charm!

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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/13666] gold-linked binary for ppc results in program-termination with illegal instruction

2012-02-06 Thread stormtroopa at gmx dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=13666

--- Comment #1 from stormtroopa at gmx dot net 2012-02-06 16:09:17 UTC ---
I just tried to compile a very small test program instead. This one terminates
with Segmentation fault

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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/13666] gold-linked binary for ppc results in program-termination with illegal instruction

2012-02-06 Thread stormtroopa at gmx dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=13666

--- Comment #2 from stormtroopa at gmx dot net 2012-02-06 16:16:01 UTC ---
Debugging the application I can see the callstack. 
Application is crashing in __libc_csu_init () with SIGSEGV.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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/13668] New: x86: objdump gets the wrong length for 66-prefixed direct jumps in 64-bit mode

2012-02-06 Thread m...@mythic-beasts.com
http://sourceware.org/bugzilla/show_bug.cgi?id=13668

 Bug #: 13668
   Summary: x86: objdump gets the wrong length for 66-prefixed
direct jumps in 64-bit mode
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: m...@mythic-beasts.com
Classification: Unclassified


objdump -d produces the following disassembly for x86-64 and shows this jb
as taking a 2-byte jump offset:

  400515:   66 0f 82 00 00  jb 51a
  40051a:   eb 02   jmp40051e

This is correct for 32-bit mode, but in 64-bit mode this jb should take a
4-byte jump offset.

I'm not sure where that CPU behaviour is documented (I find the AMD manuals
unclear on the matter), but the following test demonstrates it empirically:


#include stdio.h

asm(.global test\n
test:\n
/* Clear the carry flag so that the following jc does not jump. */
clc\n
/* 66 0f 82 is the encoding for data16 jc.  jc is also known
   as jb.  On x86-32, this takes a 2-byte operand, so it
   executes jmp size2.  On x86-64, this takes a 4-byte operand,
   so it executes jmp size4. */
.ascii \\\x66\\x0f\\x82\\x00\\x00\\n
/* We assume that this jump is encoded as a 2-byte instruction. */
jmp size2\n
jmp size4\n
size2: jmp size_is_2\n
size4: jmp size_is_4\n
);
void test(void);

void size_is_2() { printf(operand size is 2 bytes\n); }
void size_is_4() { printf(operand size is 4 bytes\n); }

int main() {
  test();
  return 0;
}


$ gcc test.c -o test -m32  ./test
operand size is 2 bytes
$ gcc test.c -o test -m64  ./test
operand size is 4 bytes

Since using the 66 prefix on direct jumps is not very useful on x86-64 -- it
only increases the size of the encoding -- we wouldn't expect to see it very
often.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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


gold-linked binary for ppc results in illegal instruction

2012-02-06 Thread Sebastian Klaar
I am using gold v1.11 (binutils v2.2) for cross-linking a program for my 
powerpc architecture.
When I execute this binary I am getting an Illegal instruction.
Readelf delivers a correct fileheader (Machine: PowerPC).

Linking with the standard GNU ld creates a runnable binary, but of course needs 
a lot longer.

I compiled gold before for arm. Worked like a charm!
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

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


[Bug ld/13666] gold-linked binary for ppc results in program-termination with illegal instruction

2012-02-06 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13666

Ian Lance Taylor ian at airs dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||ian at airs dot com
 Resolution||DUPLICATE

--- Comment #3 from Ian Lance Taylor ian at airs dot com 2012-02-07 06:38:53 
UTC ---
The gold PowerPC support is incomplete.  Sorry.

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

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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/6767] program linked with gold seg faults

2012-02-06 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6767

Ian Lance Taylor ian at airs dot com changed:

   What|Removed |Added

 CC||stormtroopa at gmx dot net

--- Comment #3 from Ian Lance Taylor ian at airs dot com 2012-02-07 06:38:53 
UTC ---
*** Bug 13666 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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


Re: gold-linked binary for ppc results in illegal instruction

2012-02-06 Thread Ian Lance Taylor
Sebastian Klaar skl...@gmx.net writes:

 I am using gold v1.11 (binutils v2.2) for cross-linking a program for my 
 powerpc architecture.
 When I execute this binary I am getting an Illegal instruction.
 Readelf delivers a correct fileheader (Machine: PowerPC).

 Linking with the standard GNU ld creates a runnable binary, but of course 
 needs a lot longer.

 I compiled gold before for arm. Worked like a charm!

The gold PowerPC support is incomplete.  Sorry.

Ian

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


[Bug gold/6767] program linked with gold seg faults

2012-02-06 Thread stormtroopa at gmx dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=6767

--- Comment #4 from stormtroopa at gmx dot net 2012-02-07 07:30:49 UTC ---
I am very sorry to here that. Are there any plans to fix it?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- 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