bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/19572] -Ttext-segment accepts out of range value


From: hjl.tools at gmail dot com
Subject: [Bug ld/19572] -Ttext-segment accepts out of range value
Date: Thu, 25 Feb 2016 12:12:02 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19572

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]