Fix bug due to unlikely sections

Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
This commit is contained in:
Gaulthier Gain 2021-10-11 11:12:38 +02:00
parent 4c49808717
commit af2095ec72

View file

@ -89,11 +89,14 @@ func compareFunctions(elf *elf64core.ELF64File, obj *elf64core.ELF64File) (uint6
objFuncs := make([]elf64core.ELF64Function, 0)
for i := len(obj.FunctionsTables) - 1; i >= 0; i-- {
if strings.Compare(obj.FunctionsTables[i].Name, elf64core.BootTextSection) != 0 {
// Ignore the '.text.boot' section since it can be split through
// Ignore the '.text.boot' and '.unlikely' sections since it can be split through
// different places
if !strings.Contains(obj.FunctionsTables[i].Name, elf64core.UnlikelySection) {
objFuncs = append(objFuncs, obj.FunctionsTables[i].Functions...)
}
}
}
// Elf: Merge all functions table(s) in one slice for simplicity
elfFuncs := make([]elf64core.ELF64Function, 0)
for i := len(elf.FunctionsTables) - 1; i >= 0; i-- {