aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-06-13 15:10:15 +0100
committerNick Clifton <nickc@redhat.com>2024-06-13 15:10:15 +0100
commite8e10743f7b207b21a1efb0cc9e42487080db013 (patch)
treedaeed5b3fb3bdadce5bc0b6297cca0c96aee37a7 /bfd
parent888ff82e77d9ab8f04893a68cd6b4f518d6b50d9 (diff)
downloadgdb-e8e10743f7b207b21a1efb0cc9e42487080db013.zip
gdb-e8e10743f7b207b21a1efb0cc9e42487080db013.tar.gz
gdb-e8e10743f7b207b21a1efb0cc9e42487080db013.tar.bz2
Add --rosegment option to BFD linker to stop the '-z separate-code' from generating two read-only segments.
PR 30907
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 74236a6..b0b1e94 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5335,7 +5335,9 @@ _bfd_elf_map_sections_to_segments (bfd *abfd,
thus not executable, and the first section is
executable then put the file and program headers in
their own PT_LOAD. */
- separate_phdr = true;
+ if (!info->one_rosegment)
+ separate_phdr = true;
+
if ((((phdr_lma + phdr_size - 1) & addr_mask & -maxpagesize)
== (sections[0]->lma & addr_mask & -maxpagesize)))
{