[Bug ld/10911] New: ld -s -static breaks IRELATIVE relocations

2009-11-06 Thread jakub at redhat dot com
.text
.type foo, @gnu_indirect_function
.globl foo
foo:
leaq __foo(%rip), %rax
retq
.type __foo, @function
__foo:
retq
.type _start, @function
.globl _start
_start:
call foo
1: jmp 1b

$ as -o t.o t.s
$ ld -static -o t t.o
$ readelf -Wr t
Relocation section '.rela.plt' at offset 0xb0 contains 1 entries:
Offset Info Type   Symbol's Value 
Symbol's Name + Addend
006000e8  0025 R_X86_64_IRELATIVE   
  004000d8
$ strip t
$ readelf -Wr t
Relocation section '.rela.plt' at offset 0xb0 contains 1 entries:
Offset Info Type   Symbol's Value 
Symbol's Name + Addend
006000e8  0025 R_X86_64_IRELATIVE   
  004000d8
$ ld -static -s -o t t.o
Relocation section '.rela.plt' at offset 0xb0 contains 1 entries:
Offset Info Type   Symbol's Value 
Symbol's Name + Addend
   R_X86_64_NONE
  

While this minimal testcase won't work in any case, when actually linking a real
program (say replace _start with main and link with -lc), the program will die
because of unexpected reloc type in statically linked binary.

-- 
   Summary: ld -s -static breaks IRELATIVE relocations
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: jakub at redhat dot com
CC: bug-binutils at gnu dot org
GCC target triplet: x86_64-linux


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

--- 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/10887] building memtest86 causes segfault in LD.

2009-11-06 Thread scott dot sourceware dot 2009 at scottrix dot co dot uk

--- Additional Comments From scott dot sourceware dot 2009 at scottrix dot 
co dot uk  2009-11-06 09:40 ---
Applied the patches to binutils-2.20 and it makes no difference to the
segmentation fault.  I also added the line:

.rel.dyn : { *(.rel.dyn.rel.dyn.*) }

to the memtest86 memtest_shared.lds linker script.

-- 
   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


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

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