Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIPS: fix emitDirectiveCpsetup on N32 #80534

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Commits on Feb 22, 2024

  1. MIPS: fix emitDirectiveCpsetup on N32

    In the current code, we don't support -mno-shared yet, and
    for N32, .cpsetup is expand as the style -f -mno-shared.
    
    It will generate bad code for PIC binaries like:
    00000000 <t1>:
       0:   ffbc0008        sd      gp,8(sp)
       4:   3c1c0000        lui     gp,0x0
                            4: R_MIPS_HI16  __gnu_local_gp
       8:   279c0000        addiu   gp,gp,0
                            8: R_MIPS_LO16  __gnu_local_gp
    
    In fact which style of .cpsetup is used should be determined
    by -m(no-)shared option instead of -mabi=n32 option.
    
    Fixes: llvm#52785
    wzssyqa committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    0e9ab65 View commit details
    Browse the repository at this point in the history