Bug 30592 - objcopy --set-section-flags: support "large" for SHF_X86_64_LARGE
Summary: objcopy --set-section-flags: support "large" for SHF_X86_64_LARGE
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Fangrui Song
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-28 01:04 UTC by Fangrui Song
Modified: 2023-07-09 18:09 UTC (History)
0 users

See Also:
Host:
Target: x86_64-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2023-06-28 01:04:38 UTC
Linkers may place SHF_X86_64_LARGE sections away from regular sections to alleviate relocation overflow pressure [1]. It would be nice to have the ability to add the SHF_X86_64_LARGE flag to sections in relocatable object files, especially for prebuilt object files that the user cannot control.

I suggest that we allow   objcopy --set-section-flags .data=alloc,large
to set SHF_X86_64_LARGE.


[1]: https://maskray.me/blog/2023-05-14-relocation-overflow-and-code-models
Comment 2 Fangrui Song 2023-07-09 18:09:54 UTC
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5e24da908dbf6ddeb03e2b194f6b39dea3c660f3

Used PATCH v4 with a modification: https://sourceware.org/pipermail/binutils/2023-July/128334.html

This is a minor feature, so I do not rush it into the upcoming binutils 2.41 release.

Possible target milestone: binutils 2.42