Bug 32100 - --rosegment moves the build-id note away from the start of the file
Summary: --rosegment moves the build-id note away from the start of the file
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.43
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-19 10:47 UTC by Nick Clifton
Modified: 2024-09-27 14:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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