[Bug ld/19623] regression: erroneous relocation for symbols in absolute section (vma == 0)

2016-02-25 Thread winter-...@bfw-online.de
https://sourceware.org/bugzilla/show_bug.cgi?id=19623

--- Comment #6 from winter-...@bfw-online.de ---
Judging from the correspondence regarding the fix for DJGPP [1] it seems that
DJGPP and SCO differ in their behaviour when it comes to relocating symbols in
absolute sections (== those with vma=0). While DJGPP was broken when relocation
was turned off, SCO worked. Currently, it is the other way round.
Some info on djgpp [2] and SCO (albeit ELF, see SHN_ABS) [3].

[1] https://lists.gnu.org/archive/html/bug-binutils/2015-06/msg00010.html
[2] http://www.delorie.com/djgpp/doc/coff/reloc.html
[3] http://www.sco.com/developers/gabi/latest/ch4.sheader.html

-- 
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/19572] -Ttext-segment accepts out of range value

2016-02-25 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19572

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Created attachment 9037
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9037&action=edit
Add check of segment addresses

Hi H.J.

  Please could you try out this patch and let me know if it works for you.

Cheers
  Nick

-- 
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/19572] -Ttext-segment accepts out of range value

2016-02-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19572

--- Comment #2 from H.J. Lu  ---
(In reply to Nick Clifton from comment #1)
> Created attachment 9037 [details]
> Add check of segment addresses
> 
> Hi H.J.
> 
>   Please could you try out this patch and let me know if it works for you.
> 
> Cheers
>   Nick

+  if (bfd_arch_bits_per_address (link_info.output_bfd) < (sizeof (bfd_vma) *
8))
+{

It doesn't work for x32 which has has 64-bit arch address and 32-bit
pointer.

+  segment_type * seg;
+  bfd_vma max = ((bfd_vma) 1) << bfd_arch_bits_per_address
(link_info.output_bfd);
+
+  for (seg = segments; seg; seg = seg->next)
+   if (seg->value >= max)
+ einfo (_("%P%X: Segment %s address %V is bigger than maximum address
%V\n"),
+seg->name, seg->value, max - 1);
+}

-- 
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/19572] -Ttext-segment accepts out of range value

2016-02-25 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19572

--- Comment #3 from Nick Clifton  ---
Hi H,J,

> +  if (bfd_arch_bits_per_address (link_info.output_bfd) < (sizeof (bfd_vma) *
> 8))
> +{
> 
> It doesn't work for x32 which has has 64-bit arch address and 32-bit
> pointer.

Umm, are you sure ?  Could you create a test case for me to check please ?

Cheers
  Nick

-- 
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/19704] Missing dynamic relocation against undefined weak symbol

2016-02-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19704

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.27

--- Comment #1 from H.J. Lu  ---
We have to resolve R_X86_64_32/R_X86_64_PC32 relocations against undefined
weak symbols to zero.  Otherwise, we will get run-time relocation overflow
for dynamic R_X86_64_32/R_X86_64_PC32 relocations.

-- 
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/19572] -Ttext-segment accepts out of range value

2016-02-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19572

--- Comment #4 from H.J. Lu  ---
[hjl@gnu-6 pr19567]$ cat x.S
.globl _start
_start:
#ifdef __x86_64__
mov $_start,%rax
mov _start,%rax
#else
mov $_start,%eax
mov _start,%eax
#endif
[hjl@gnu-6 pr19567]$ make
gcc -mx32 -c -O2 -ffunction-sections -fPIC -o x.o x.S
./ld -Ttext-segment 0x8000 -m elf32_x86_64 -o x x.o
x.o: In function `_start':
(.text+0x3): relocation truncated to fit: R_X86_64_32S against symbol `_start'
defined in .text section in x.o
x.o: In function `_start':
(.text+0xb): relocation truncated to fit: R_X86_64_32S against symbol `_start'
defined in .text section in x.o
Makefile:20: recipe for target 'x' failed
make: *** [x] Error 1
[hjl@gnu-6 pr19567]$

-- 
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/19572] -Ttext-segment accepts out of range value

2016-02-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19572

--- Comment #5 from H.J. Lu  ---
[hjl@gnu-6 pr19567]$ cat x.S
.globl _start
_start:
#ifdef __x86_64__
mov $_start,%rax
mov _start,%rax
#else
mov $_start,%eax
mov _start,%eax
#endif
[hjl@gnu-6 pr19567]$ make
gcc -mx32 -c -O2 -ffunction-sections -fPIC -o x.o x.S
./ld -Ttext-segment 0x8000 -m elf32_x86_64 -o x x.o
objdump -dw x

x: file format elf32-x86-64


Disassembly of section .text:

8054 <_start>:
8054:   48 c7 c0 54 00 00 80mov$0x8054,%rax
805b:   48 8b 04 25 54 00 00 80 mov0x8054,%rax
[hjl@gnu-6 pr19567]$

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