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 15/51] objtool: mcount: Replace MIPS offset types
    Date
    Replace MIPS is_fake_mcount code using Elf_Addr with
    unsigned long for the offsets. This is consistent with the way
    that objtool more generally treats offsets and removes the
    last use of the Elf_Addr wrapper.

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

    diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h
    index 210899819261..dde2ec054e51 100644
    --- a/tools/objtool/recordmcount.h
    +++ b/tools/objtool/recordmcount.h
    @@ -31,7 +31,6 @@
    #undef set_shnum
    #undef get_shstrndx
    #undef do_func
    -#undef Elf_Addr
    #undef Elf_Ehdr
    #undef Elf_Shdr
    #undef Elf_Rel
    @@ -59,7 +58,6 @@
    # define fn_is_fake_mcount fn_is_fake_mcount64
    # define MIPS_is_fake_mcount MIPS64_is_fake_mcount
    # define mcount_adjust mcount_adjust_64
    -# define Elf_Addr Elf64_Addr
    # define Elf_Ehdr Elf64_Ehdr
    # define Elf_Shdr Elf64_Shdr
    # define Elf_Rel Elf64_Rel
    @@ -86,7 +84,6 @@
    # define fn_is_fake_mcount fn_is_fake_mcount32
    # define MIPS_is_fake_mcount MIPS32_is_fake_mcount
    # define mcount_adjust mcount_adjust_32
    -# define Elf_Addr Elf32_Addr
    # define Elf_Ehdr Elf32_Ehdr
    # define Elf_Shdr Elf32_Shdr
    # define Elf_Rel Elf32_Rel
    @@ -138,11 +135,11 @@ static int mcount_adjust = 0;

    static int MIPS_is_fake_mcount(struct reloc const *reloc)
    {
    - static Elf_Addr old_r_offset = ~(Elf_Addr)0;
    - Elf_Addr current_r_offset = reloc->offset;
    + static unsigned long old_r_offset = ~0UL;
    + unsigned long current_r_offset = reloc->offset;
    int is_fake;

    - is_fake = (old_r_offset != ~(Elf_Addr)0) &&
    + is_fake = (old_r_offset != ~0UL) &&
    (current_r_offset - old_r_offset == MIPS_FAKEMCOUNT_OFFSET);
    old_r_offset = current_r_offset;

    --
    2.20.1
    \
     
     \ /
      Last update: 2020-06-18 22:40    [W:4.128 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site