Fix bug due to unlikely sections
Signed-off-by: Gaulthier Gain <gaulthier.gain@uliege.be>
This commit is contained in:
parent
4c49808717
commit
af2095ec72
1 changed files with 6 additions and 3 deletions
|
@ -89,10 +89,13 @@ func compareFunctions(elf *elf64core.ELF64File, obj *elf64core.ELF64File) (uint6
|
||||||
objFuncs := make([]elf64core.ELF64Function, 0)
|
objFuncs := make([]elf64core.ELF64Function, 0)
|
||||||
for i := len(obj.FunctionsTables) - 1; i >= 0; i-- {
|
for i := len(obj.FunctionsTables) - 1; i >= 0; i-- {
|
||||||
if strings.Compare(obj.FunctionsTables[i].Name, elf64core.BootTextSection) != 0 {
|
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
|
// different places
|
||||||
objFuncs = append(objFuncs, obj.FunctionsTables[i].Functions...)
|
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
|
// Elf: Merge all functions table(s) in one slice for simplicity
|
||||||
elfFuncs := make([]elf64core.ELF64Function, 0)
|
elfFuncs := make([]elf64core.ELF64Function, 0)
|
||||||
|
@ -248,4 +251,4 @@ func (analyser *ElfAnalyser) computePage(elfFile *elf64core.ELF64File, section s
|
||||||
analyser.ElfPage = append(analyser.ElfPage, page)
|
analyser.ElfPage = append(analyser.ElfPage, page)
|
||||||
k++
|
k++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue