Skip to content

different bewteen gcc -fPIC -mlong-calls and clang -fPIC -mlong-calls #145510

Closed as duplicate of#39970
@LukeSTM

Description

@LukeSTM

demo:

#include <stdio.h>
int main ()
{
    printf("hello");
    return 0;
}

compile option: -fPIC -mlong-calls
target: armv7

https://godbolt.org/z/MzdPY3oTs

Hi, i am new to compiler.

In some scenarios, using dlopen to load so compiled with gcc -fPIC -mlong-calls is faster than so compiled with clang -fPIC to generate .and when i use clang -fPIC -mlong-calls compile same code, clang still slower than gcc.

i want know why gcc use GOT and clang not use GOT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other categoryduplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions