diff options
author | Fangrui Song <maskray@google.com> | 2023-07-09 10:57:19 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-07-09 10:57:19 -0700 |
commit | 5e24da908dbf6ddeb03e2b194f6b39dea3c660f3 (patch) | |
tree | e794077f7d101002abb3d965f3377ebbbb4ea0a6 /bfd/section.c | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-5e24da908dbf6ddeb03e2b194f6b39dea3c660f3.tar.gz binutils-gdb-5e24da908dbf6ddeb03e2b194f6b39dea3c660f3.tar.bz2 binutils-gdb-5e24da908dbf6ddeb03e2b194f6b39dea3c660f3.zip |
PR30592 objcopy: allow --set-section-flags to add or remove SHF_X86_64_LARGE
For example, objcopy --set-section-flags .data=alloc,large will add
SHF_X86_64_LARGE to the .data section. Omitting "large" will drop the
SHF_X86_64_LARGE flag.
The bfd_section flag is named generically, SEC_ELF_LARGE, in case other
processors want to follow SHF_X86_64_LARGE. SEC_ELF_LARGE has the same
value as SEC_TIC54X_BLOCK used by coff.
bfd/
* section.c: Define SEC_ELF_LARGE.
* bfd-in2.h: Regenerate.
* elf64-x86-64.c (elf_x86_64_section_flags, elf_x86_64_fake_sections,
elf_x86_64_copy_private_section_data): New.
binutils/
* NEWS: Mention the new feature for objcopy.
* doc/binutils.texi: Mention "large".
* objcopy.c (parse_flags): Parse "large".
(check_new_section_flags): Error if "large" is used with a
non-x86-64 ELF target.
* testsuite/binutils-all/x86-64/large-sections.d: New.
* testsuite/binutils-all/x86-64/large-sections.s: New.
* testsuite/binutils-all/x86-64/large-sections-i386.d: New.
* testsuite/binutils-all/x86-64/large-sections-2.d: New.
* testsuite/binutils-all/x86-64/large-sections-2-x32.d: New.
Diffstat (limited to 'bfd/section.c')
-rw-r--r-- | bfd/section.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/section.c b/bfd/section.c index 73770294e56..e9af59dfd15 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -359,6 +359,9 @@ CODE_FRAGMENT . TMS320C54X only. *} .#define SEC_TIC54X_BLOCK 0x10000000 . +. {* This section has the SHF_X86_64_LARGE flag. This is ELF x86-64 only. *} +.#define SEC_ELF_LARGE 0x10000000 +. . {* Conditionally link this section; do not link if there are no . references found to any symbol in the section. This is for TI . TMS320C54X only. *} |