lkml.org 
[lkml]   [2020]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH v5 07/51] objtool: mcount: Move nhdr into find_symtab()
Date
Since it's no longer needed in the rest of do_func() we can move
it to where it's needed rather than pass it as a parameter.

Signed-off-by: Matt Helsley <mhelsley@vmware.com>
---
tools/objtool/recordmcount.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h
index b46e855d32bf..4bd61c9d1fd5 100644
--- a/tools/objtool/recordmcount.h
+++ b/tools/objtool/recordmcount.h
@@ -229,9 +229,10 @@ static int get_shstrndx(Elf_Ehdr const *ehdr, Elf_Shdr const *shdr0)
}

static void find_symtab(Elf_Ehdr *const ehdr, Elf_Shdr const *shdr0,
- unsigned const nhdr, Elf32_Word **symtab,
+ Elf32_Word **symtab,
Elf32_Word **symtab_shndx)
{
+ unsigned const nhdr = get_shnum(ehdr, shdr0);
Elf_Shdr const *relhdr;
unsigned k;

@@ -593,7 +594,6 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
{
Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
+ (void *)ehdr);
- unsigned const nhdr = get_shnum(ehdr, shdr0);
Elf_Shdr *const shstr = &shdr0[get_shstrndx(ehdr, shdr0)];
char const *const shstrtab = (char const *)(_w(shstr->sh_offset)
+ (void *)ehdr);
@@ -638,7 +638,7 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
return -1;
}

- find_symtab(ehdr, shdr0, nhdr, &symtab, &symtab_shndx);
+ find_symtab(ehdr, shdr0, &symtab, &symtab_shndx);

list_for_each_entry(sec, &lf->sections, list) {
char const *txtname;
--
2.20.1
\
 
 \ /
  Last update: 2020-06-18 22:43    [W:0.347 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site