[Bug ld/32896] GNU ld does not enforce PT_TLS segment p_offset/p_vaddr congruity with p_align

2025-04-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32896

--- Comment #2 from H.J. Lu  ---
Created attachment 16053
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16053&action=edit
A patch

Please try this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/32896] GNU ld does not enforce PT_TLS segment p_offset/p_vaddr congruity with p_align

2025-04-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32896

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING
 CC||hjl.tools at gmail dot com
   Last reconfirmed||2025-04-27
Version|unspecified |2.45 (HEAD)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/25662] objcopy sets invalid sh_offset for the first section in a no_contents segment containing program headers

2025-04-27 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=25662

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32896

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/32896] GNU ld does not enforce PT_TLS segment p_offset/p_vaddr congruity with p_align

2025-04-27 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32896

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=25662

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/4499] assign file positions assumes segment offsets increasing

2025-04-27 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=4499

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=25662

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/25662] objcopy sets invalid sh_offset for the first section in a no_contents segment containing program headers

2025-04-27 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=25662

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=4499,
   ||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=23595

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/23595] "simple objcopy of executable" failure for msp430-elf with -mlarge

2025-04-27 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23595

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=25662

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/32896] GNU ld does not enforce PT_TLS segment p_offset/p_vaddr congruity with p_align

2025-04-27 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32896

--- Comment #3 from Alan Modra  ---
HJ's patch looks good except that the new test fails for me..

Also the comment needs tweaking.  I'd suggest something like:

  /* Set sh_offset for .tbss sections to their nominal
 offset after aligning.  They are not loaded from
 disk so the value doesn't really matter, except
 when the .tbss section is the first one in a
 PT_TLS segment.  In that case it sets the
 p_offset for the PT_TLS segment, which according
 to the ELF gABI ought to satisfy
 p_offset % p_align == p_vaddr % p_align.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/32896] GNU ld does not enforce PT_TLS segment p_offset/p_vaddr congruity with p_align

2025-04-27 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32896

--- Comment #4 from H.J. Lu  ---
(In reply to Alan Modra from comment #3)
> HJ's patch looks good except that the new test fails for me..

What is your target?

> Also the comment needs tweaking.  I'd suggest something like:
> 
> /* Set sh_offset for .tbss sections to their nominal
>offset after aligning.  They are not loaded from
>disk so the value doesn't really matter, except
>when the .tbss section is the first one in a
>PT_TLS segment.  In that case it sets the
>p_offset for the PT_TLS segment, which according
>to the ELF gABI ought to satisfy
>p_offset % p_align == p_vaddr % p_align.  */

Thanks.  Will update it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.