Bug 30251 - eu-elflint is broken on LoongArch
Summary: eu-elflint is broken on LoongArch
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: backends (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-20 14:52 UTC by Alexey Sheplyakov
Modified: 2023-03-20 22:37 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch: basic implementation of machine flag check for LoongArch (728 bytes, patch)
2023-03-20 14:52 UTC, Alexey Sheplyakov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Sheplyakov 2023-03-20 14:52:35 UTC
Created attachment 14768 [details]
patch: basic implementation of machine flag check for LoongArch

eu-elflint is unhappy about any LoongArch (lp64d ABI) ELF binary, in particular, about itself:

$ ./src/elflint --gnu-ld ./src/elflint
invalid machine flags: 0x43
$ echo $?
1
Comment 1 Mark Wielaard 2023-03-20 22:37:10 UTC
Thanks, that looks perfect. Pushed as:

commit b2871fa8d430e2c5fb39e3ebc6745ea32f1bddb4
Author: Alexey Sheplyakov <asheplyakov@basealt.ru>
Date:   Mon Mar 20 18:45:02 2023 +0400

    LoongArch: implemented a basic machine flag check
    
    With this patch I can use eu-elflint to verify LoongArch ELF
    binaries. Previously eu-elflint was complaining about invalid
    machine flags:
    
    $ ./src/elflint --gnu-ld ./src/elflint
    invalid machine flags: 0x43
    $ echo $?
    1
    
        * backends/loongarch_symbol.c (loongarch_init): Hook
        machine_flag_check.
        * backends/loongarch_symbol.c (loongarch_machine_flag_check):
        New function.
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=30251
    
    Signed-off-by: Alexey Sheplyakov <asheplyakov@basealt.ru>