diff options
author | Fangrui Song <i@maskray.me> | 2024-02-09 12:09:42 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-02-09 12:09:42 -0800 |
commit | 5f26b902d59b98ffa450f7bae508b330d0184d0d (patch) | |
tree | 86f0ae0d24e040fbe6b8033adea24d9ada074bad /lld | |
parent | bb180856ec28efe305dc77ca4bb3db12d8932edf (diff) | |
download | llvm-5f26b902d59b98ffa450f7bae508b330d0184d0d.zip llvm-5f26b902d59b98ffa450f7bae508b330d0184d0d.tar.gz llvm-5f26b902d59b98ffa450f7bae508b330d0184d0d.tar.bz2 |
[ELF] Apply forgotten change to #81223
Diffstat (limited to 'lld')
-rw-r--r-- | lld/ELF/Writer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 53ca70b..bd4db1e 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -2446,8 +2446,8 @@ SmallVector<PhdrEntry *, 0> Writer<ELFT>::createPhdrs(Partition &part) { // Segments are contiguous memory regions that has the same attributes // (e.g. executable or writable). There is one phdr for each segment. // Therefore, we need to create a new phdr when the next section has - // compatible flags or is loaded at a discontiguous address or memory region - // using AT or AT> linker script command, respectively. + // incompatible flags or is loaded at a discontiguous address or memory + // region using AT or AT> linker script command, respectively. // // As an exception, we don't create a separate load segment for the ELF // headers, even if the first "real" output has an AT or AT> attribute. @@ -2461,10 +2461,10 @@ SmallVector<PhdrEntry *, 0> Writer<ELFT>::createPhdrs(Partition &part) { // needed to create a new LOAD) uint64_t newFlags = computeFlags(sec->getPhdrFlags()); // When --no-rosegment is specified, RO and RX sections are compatible. - uint32_t diff = flags ^ newFlags; + uint32_t incompatible = flags ^ newFlags; if (config->singleRoRx && !(newFlags & PF_W)) - diff &= ~PF_X; - if (diff) + incompatible &= ~PF_X; + if (incompatible) load = nullptr; bool sameLMARegion = |