[Bug gold/12324] GOLD do not diagnoze when non-PIC code is linked into shared library

2010-12-15 Thread jh at suse dot de
http://sourceware.org/bugzilla/show_bug.cgi?id=12324

--- Comment #2 from jh at suse dot de 2010-12-15 13:39:18 UTC ---
With GNU ld I get:
/abuild/jh/trunk-install/bin/gcc  -O3 -flto -flto-partition=none  
-fuse-linker-plugin -shared -Wl,-soname -Wl,libnspr4.so  -o  
libnspr4.so ./prvrsion.o io/./prfdcach.o io/./prmwait.o  
io/./prmapopt.o io/./priometh.o io/./pripv6.o io/./prlayer.o  
io/./prlog.o io/./prmmap.o io/./prpolevt.o io/./prprf.o io/./prscanf.o  
io/./prstdio.o threads/./prcmon.o threads/./prrwlock.o  
threads/./prtpd.o linking/./prlink.o malloc/./prmalloc.o  
malloc/./prmem.o md/./prosdep.o memory/./prshm.o memory/./prshma.o  
memory/./prseg.o misc/./pralarm.o misc/./pratom.o misc/./prcountr.o  
misc/./prdtoa.o misc/./prenv.o misc/./prerr.o misc/./prerror.o  
misc/./prerrortable.o misc/./prinit.o misc/./prinrval.o misc/./pripc.o  
misc/./prlog2.o misc/./prlong.o misc/./prnetdb.o misc/./praton.o  
misc/./prolock.o misc/./prrng.o misc/./prsystem.o misc/./prthinfo.o  
misc/./prtpool.o misc/./prtrace.o misc/./prtime.o pthreads/./ptsynch.o  
pthreads/./ptio.o pthreads/./ptthread.o pthreads/./ptmisc.o  
md/unix/./unix.o md/unix/./unix_errors.o md/unix/./uxproces.o  
md/unix/./uxrng.o md/unix/./uxshm.o md/unix/./uxwrap.o  
md/unix/./linux.o md/unix/./os_Linux_x86_64.o   -lpthread -ldl
/abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
/tmp/ccoCztSC.lto.o: relocation R_X86_64_PC32 against symbol `PR_Unlock' can
not be used when making a shared object; recompile with  
-fPIC
/abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
final link failed: Bad  
value

with gold build passes. GNU ld is right that GCC produce non-PIC code  
here and adding -fPIC fixes the problem.
evans:/abuild/jh/build-mozilla-new7/:[2]#  
/abuild/jh/trunk-install/bin/ld-goldnew --version
GNU gold (GNU Binutils 2.20.51.20100706) 1.9
Copyright 2010 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

more recent golds do not build for me with syntax errors:
In file included from ../../gold/script-c.h:211,
  from yyscript.y:35:
../../gold/yyscript.h:195:1: error: "LENGTH" redefined
yyscript.c:124:1: error: this is the location of the previous definition
../../gold/yyscript.h:196:1: error: "LOADADDR" redefined
yyscript.c:125:1: error: this is the location of the previous definition
../../gold/yyscript.h:197:1: error: "LOCAL" redefined
yyscript.c:126:1: error: this is the location of the previous definition
../../gold/yyscript.h:198:1: error: "LONG" redefined

didn't looked yet into why.

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/12324] GOLD do not diagnoze when non-PIC code is linked into shared library

2010-12-15 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12324

--- Comment #3 from Ian Lance Taylor  2010-12-15 14:27:03 
UTC ---
But GNU ld is wrong here.  There is absolutely nothing wrong with resolving a
R_X86_64_PC32 reloc when creating a shared library.  There is no need to
recompile with -fPIC if the only problem is a R_X86_64_PC32 reloc.  This does
not look like a bug in gold.

As far as the problems building gold go, there is something strange happening,
because you are picking up yyscript.h from the source directory but getting
yyscript.c from the build directory.  They are both generated files.  Certainly
the simple fix is going to be to delete them from the source directory.

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/12324] GOLD do not diagnoze when non-PIC code is linked into shared library

2010-12-15 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12324

--- Comment #4 from Ian Lance Taylor  2010-12-15 14:43:15 
UTC ---
Wait, sorry, I'm wrong; there are cases where R_X86_64_PC32 can't be used in a
shared library.

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/12324] GOLD do not diagnoze when non-PIC code is linked into shared library

2010-12-15 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12324

--- Comment #5 from cvs-commit at gcc dot gnu.org  2010-12-15 15:35:31 UTC ---
CVSROOT:/cvs/src
Module name:src
Changes by:i...@sourceware.org2010-12-15 15:35:28

Modified files:
gold   : ChangeLog x86_64.cc 
gold/testsuite : Makefile.am Makefile.in 

Log message:
PR gold/12324
* x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
for R_X86_64_32 and R_X86_64_PC32.
* testsuite/Makefile.am (ver_matching_def.so): Depend on and use
ver_matching_def_pic.o.
(ver_matching_def_pic.o): New target.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.680&r2=1.681
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/x86_64.cc.diff?cvsroot=src&r1=1.120&r2=1.121
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/Makefile.am.diff?cvsroot=src&r1=1.152&r2=1.153
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/Makefile.in.diff?cvsroot=src&r1=1.161&r2=1.162

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/12324] GOLD do not diagnoze when non-PIC code is linked into shared library

2010-12-15 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12324

Ian Lance Taylor  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #6 from Ian Lance Taylor  2010-12-15 15:46:53 
UTC ---
Fixed.

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12291] "ld -r" doesn't work with mixed IR/non-IR objects

2010-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12291

H.J. Lu  changed:

   What|Removed |Added

 AssignedTo|unassigned at sources dot   |hjl.tools at gmail dot com
   |redhat.com  |

--- Comment #2 from H.J. Lu  2010-12-15 19:17:03 
UTC ---
The proposal is at

http://www.kernel.org/pub/linux/devel/gcc/lto/mixed-IR/mixed-IR.pdf

It is implemented on hjl/lto-mixed branch at

http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12325] New: ar --target isn't documented

2010-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12325

   Summary: ar --target isn't documented
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sources.redhat.com
ReportedBy: hjl.to...@gmail.com


--target option was added to ar. But it isn't documented and
"ar --help" doesn't show the new option.

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12327] New: x86 relocatable kernel is broken

2010-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12327

   Summary: x86 relocatable kernel is broken
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: hjl.to...@gmail.com


In linux kernel, we have ‘jiffies = jiffies_64;’ in vmlinux.lds.S.
The jiffies isn’t in any section. In kernel build, there is warning saying
jiffies is an absolute address and can't relocatable. In my system, this cause
boot panic. 

Kernel config has

CONFIG_RELOCATABLE=y

Kernel build log has

WARNING: Absolute relocations present
Offset Info Type Sym.Value Sym.Name
c102cc8a 00de5a01   R_386_32 c170ba40  jiffies
c103635d 00de5a01   R_386_32 c170ba40  jiffies
c1036658 00de5a01   R_386_32 c170ba40  jiffies

Linker command is

ld -m elf_i386 --emit-relocs --build-id -o vmlinux -T
arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_32.o arch/x86/kernel/head32.o
arch/x86/kernel/head.o arch/x86/kernel/init_task.o  init/built-in.o
--start-group  usr/built-in.o  arch/x86/built-in.o  kernel/built-in.o 
mm/built-in.o  fs/built-in.o  ipc/built-in.o  security/built-in.o 
crypto/built-in.o  block/built-in.o  lib/lib.a  arch/x86/lib/lib.a 
lib/built-in.o  arch/x86/lib/built-in.o  drivers/built-in.o  sound/built-in.o 
firmware/built-in.o  arch/x86/pci/built-in.o  arch/x86/oprofile/built-in.o 
arch/x86/power/built-in.o  arch/x86/video/built-in.o  net/built-in.o
--end-group .tmp_kallsyms2.o

arch/x86/kernel/vmlinux.lds has

OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(phys_startup_32)
jiffies = jiffies_64;
PHDRS {
 text PT_LOAD FLAGS(5); /* R_E */
 data PT_LOAD FLAGS(7); /* RWE */
 note PT_NOTE FLAGS(0); /* ___ */
}

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12327] x86 relocatable kernel is broken

2010-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12327

H.J. Lu  changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #1 from H.J. Lu  2010-12-16 04:26:19 
UTC ---
It is caused by

http://sourceware.org/ml/binutils/2010-08/msg00169.html

-- 
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
http://lists.gnu.org/mailman/listinfo/bug-binutils