[Bug gold/11533] New: gold generates bad DSO

2010-04-23 Thread hjl dot tools at gmail dot com
Gold generates bad DSO in some cases.

-- 
   Summary: gold generates bad DSO
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: ian at airs dot com
ReportedBy: hjl dot tools at gmail dot com
CC: bug-binutils at gnu dot org


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

--- 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 gold/11533] gold generates bad DSO

2010-04-23 Thread hjl dot tools at gmail dot com

--- Additional Comments From hjl dot tools at gmail dot com  2010-04-23 
17:56 ---
Created an attachment (id=4749)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4749&action=view)
A testcase

[...@gnu-6 alignment-4]$ make
cc-c -o foo.o foo.c
ld -z max-page-size=0x1000 -shared -o libld.so foo.o
cc -o main1 main.o libld.so -Wl,-rpath,.
ld.gold -z max-page-size=0x1000 -shared -o libgold.so foo.o
cc -o main2 main.o libgold.so -Wl,-rpath,.
./main1
foo: 0x604000, 128
./main2
./main2: error while loading shared libraries: libgold.so: ELF load command
address/offset not properly aligned
make: *** [all] Error 127
[...@gnu-6 alignment-4]$ 

-- 


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

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


Re: [PTLsim-devel] ptlsim stops immediately

2010-04-23 Thread Stephan Diestelhorst
Sergey E. Galanov wrote:
> On Thu, Apr 22, 2010 at 10:44:16AM +0200, Martin Pohlack wrote:
> > I use intrepid (8.10) not jaunty in my changeroot, I had this wrong
> > in my earlier email.
> > 
> > $ gcc-4.2 --version
> > gcc-4.2 (GCC) 4.2.4 (Ubuntu 4.2.4-3ubuntu4)
> > Copyright (C) 2007 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > 
> > This gcc works fine here.
> > 
> > Checkout the chroot route, it works nice here after some setup effort.
>
> Thank you. That helped.

I think I have a possible root cause for this: The version of the
binutils, in particular GAS. It seems that in newer versions indirect
jumps with Intel syntax are broken:

#> cat indirect_jmp.S
.text
.intel_syntax
jmp  [func_p]
.data
func_p:
.quad 0

Results in:
GNU assembler version 2.18.93 (x86_64-linux-gnu) using BFD version (GNU 
Binutils for Ubuntu) 2.18.93.20081009

#> objdump -d indirect_jmp.o.ubuntu_8.10
indirect_jmp.o.ubuntu_8.10: file format elf64-x86-64
Disassembly of section .text:
 <.text>:
   0:   ff 24 25 00 00 00 00jmpq   *0x0

vs.
GNU assembler version 2.20 (x86_64-linux-gnu) using BFD version (GNU Binutils 
for Ubuntu) 2.20

#> objdump -d indirect_jmp.o.ubuntu_9.10
indirect_jmp.o.ubuntu_9.10: file format elf64-x86-64
Disassembly of section .text:
 <.text>:
   0:   e9 00 00 00 00  jmpq   5 

This code is used to enter simulation through the lowlevel-*.S
functions, and clearly the newer binutils f*ck that up.

I wonder what would be the smartest thing to do:
1) Change our code to AT&T syntax.
2) Try to find an Intel syntax work around
3) Get this fixed in GAS

Comments?

Cheers,
  Stephan
-- 
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34
85609 Aschheim
Germany

Geschäftsführer: Andrew Bowd; Thomas M. McCoy; Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis München
Registergericht München, HRB Nr. 43632



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