[PATCH] D36749: [LLD][ELF][AArch64] Complete implementation of -fix-cortex-a53-843419
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 18:07:01 PDT 2017
ruiu added a comment.
I have an impression that this patch can be simplified.
Does it make sense to separate Patch and PatchSection? Naively, I was thinking that patching can be done this way.
1. Fix the output layout
2. Scan all input sections in address-increasing order while creating and adding patch sections
In step 2, we create a synthetic patch section for each problematic instruction and add it after the current input section. When you add a synthetic patch section, you already know the distance from the problematic instruction and the synthetic patch section, so you don't need to create Relocation but can just fix instruction operands.
================
Comment at: ELF/SectionPatcher.cpp:65
+// Patch consists of:
+// Instruction 4.) load/store register (unsigned immediate)
+// Branch to next instruction after instruction 4.
----------------
What is "Instruction 4"?
================
Comment at: ELF/SyntheticSections.h:760
+ size_t Size = 0;
+ size_t AlignToSize;
+};
----------------
By convention, AlignToSize -> Alignment, if it means an (required) alignment.
https://reviews.llvm.org/D36749
More information about the llvm-commits
mailing list