Skip to content

Commit d69ae94

Browse files
committed
Add more comments
1 parent 5c68564 commit d69ae94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOUserDefinedSection.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,13 @@ public RelocationRecord markRelocationSite(int offset, ByteBuffer bb, Relocation
218218
case AARCH64_R_AARCH64_LDST8_ABS_LO12_NC:
219219
case AARCH64_R_AARCH64_ADD_ABS_LO12_NC:
220220
if (explicitAddend != 0) {
221-
// Create ARM64_RELOC_ADDEND
221+
/*
222+
* These relocations should use an explicit addend reloc record instead of an embedded addend,
223+
* according to the Mach-O ld code at
224+
* https://opensource.apple.com/source/ld64/ld64-274.2/src/ld/parsers/macho_relocatable_file.cpp.auto.html
225+
*
226+
* > xxxx instruction at xxxx has embedded addend. ARM64_RELOC_ADDEND should be used instead
227+
*/
222228
RelocationInfo addend = RelocationInfo.newAddend(el, this, offset, length, explicitAddend);
223229
el.add(addend);
224230
}

0 commit comments

Comments
 (0)