Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8f565b

Browse files
author
git apple-llvm automerger
committed
Merge commit 'c5d8bd5a35cb' from llvm.org/main into next
2 parents 97ee400 + c5d8bd5 commit d8f565b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/tools/llvm-objcopy/ELF/Object.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ template <class ELFT>
11871187
Error ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) {
11881188
ELF::Elf32_Word *Buf =
11891189
reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset);
1190-
*Buf++ = Sec.FlagWord;
1190+
support::endian::write32<ELFT::TargetEndianness>(Buf++, Sec.FlagWord);
11911191
for (SectionBase *S : Sec.GroupMembers)
11921192
support::endian::write32<ELFT::TargetEndianness>(Buf++, S->Index);
11931193
return Error::success();
@@ -1517,7 +1517,8 @@ Error ELFBuilder<ELFT>::initGroupSection(GroupSection *GroupSec) {
15171517
reinterpret_cast<const ELF::Elf32_Word *>(GroupSec->Contents.data());
15181518
const ELF::Elf32_Word *End =
15191519
Word + GroupSec->Contents.size() / sizeof(ELF::Elf32_Word);
1520-
GroupSec->setFlagWord(*Word++);
1520+
GroupSec->setFlagWord(
1521+
support::endian::read32<ELFT::TargetEndianness>(Word++));
15211522
for (; Word != End; ++Word) {
15221523
uint32_t Index = support::endian::read32<ELFT::TargetEndianness>(Word);
15231524
Expected<SectionBase *> Sec = SecTable.getSection(

0 commit comments

Comments
 (0)