summaryrefslogtreecommitdiff
path: root/debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2021-08-24 20:16:12 -0400
committerFelipe Sateler <fsateler@debian.org>2021-08-24 20:16:12 -0400
commit3922f6b9908fb603207169b3f5fb4670da6c0d13 (patch)
treefd6017332d34c66156d9d654caae9bc0947db791 /debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch
parent077975126dd8dd796113f7819f929181fdf9d921 (diff)
Update MIPS fix patch with what was merged upstream
It didnt make 0.13, but it will be there for 0.14
Diffstat (limited to 'debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch')
-rw-r--r--debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch23
1 files changed, 12 insertions, 11 deletions
diff --git a/debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch b/debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch
index ed33108..dfd35fb 100644
--- a/debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch
+++ b/debian/patches/Adjust-PT_MIPS_ABIFLAGS-segment-if-present.patch
@@ -14,14 +14,14 @@ Closes: #82
Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
---
src/elf.h | 7 ++++---
- src/patchelf.cc | 11 +++++++++++
- 2 files changed, 15 insertions(+), 3 deletions(-)
+ src/patchelf.cc | 12 ++++++++++++
+ 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/elf.h b/src/elf.h
-index e4e167c..a92289d 100644
+index ae1524a..b3e567c 100644
--- a/src/elf.h
+++ b/src/elf.h
-@@ -1572,9 +1572,10 @@ typedef struct
+@@ -1574,9 +1574,10 @@ typedef struct
/* Legal values for p_type field of Elf32_Phdr. */
@@ -36,22 +36,23 @@ index e4e167c..a92289d 100644
/* Special program header types. */
diff --git a/src/patchelf.cc b/src/patchelf.cc
-index 18e1f83..31013a4 100644
+index d713728..ac8b2cd 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
-@@ -742,6 +742,17 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
+@@ -757,6 +757,18 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
}
}
+ /* If there is .MIPS.abiflags section, then the PT_MIPS_ABIFLAGS
+ segment must be sync'ed with it. */
+ if (sectionName == ".MIPS.abiflags") {
-+ for (unsigned int j = 0; j < phdrs.size(); ++j)
-+ if (rdi(phdrs[j].p_type) == PT_MIPS_ABIFLAGS) {
-+ phdrs[j].p_offset = shdr.sh_offset;
-+ phdrs[j].p_vaddr = phdrs[j].p_paddr = shdr.sh_addr;
-+ phdrs[j].p_filesz = phdrs[j].p_memsz = shdr.sh_size;
++ for (auto & phdr : phdrs) {
++ if (rdi(phdr.p_type) == PT_MIPS_ABIFLAGS) {
++ phdr.p_offset = shdr.sh_offset;
++ phdr.p_vaddr = phdr.p_paddr = shdr.sh_addr;
++ phdr.p_filesz = phdr.p_memsz = shdr.sh_size;
+ }
++ }
+ }
+
curOff += roundUp(i.second.size(), sectionAlignment);