Bug 32100

Summary: --rosegment moves the build-id note away from the start of the file
Product: binutils Reporter: Nick Clifton <nickc>
Component: ldAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: aburgess, mark, sam
Priority: P2    
Version: 2.43   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Nick Clifton 2024-08-19 10:47:41 UTC
As reported here:

  https://sourceware.org/pipermail/binutils/2024-August/136267.html

When linking binaries with --rosegment enabled the .note.build-id section is moved away from the ELF headers.  This causes problems for GDB since it relies upon the fact that when the kernel creates core dumps it includes the first page of the executable's memory map.  A page which used to include the .note.build-id section.  With this information GDB is able to further process the core file.
Comment 1 Nick Clifton 2024-09-27 10:12:05 UTC
Fixed by commit bf6d7087de0a7351fd1dfd5f41522a7f4f576180
Comment 2 H.J. Lu 2024-09-27 12:05:08 UTC
(In reply to Nick Clifton from comment #1)
> Fixed by commit bf6d7087de0a7351fd1dfd5f41522a7f4f576180

Since this commit isn't backported to 2.43 branch, should we apply

https://sourceware.org/pipermail/binutils/2024-September/136865.html

to fix -z separate-code on 2.43 branch?
Comment 3 Nick Clifton 2024-09-27 14:16:37 UTC
Hi H.J.

That makes sense.  Please go ahead and apply the patch to the branch.

Cheers
  Nick