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

Introduce new relocation for landing pad #452

Open
wants to merge 6 commits into
base: complex-label-lp
Choose a base branch
from

Commits on Oct 14, 2024

  1. Introduce new relocation for landing pad

    The R_RISCV_LPAD relocation can be used for PLT entry generation and also for
    linker relaxation. Additionally, we defined a new mapping symbol type to help
    users understand the function signature for the corresponding function.
    
    The addend value is the label value, and it will point to the mapping symbol
    placed at the beginning of the function.
    
    e.g.
    ```asm
    foo:         # void foo(void)
    $sFvvE:
        lpad 123 # R_RISCV_LPAD $sFvvE + 123
    ```
    
    We propose two linker relaxations for the landing pad. The first is removing
    the entire landing pad, which can be used when symbols have local visibility,
    and the address is not taken by any other reference. The second is a landing
    pad scheme conversion, designed for backward compatibility (or as a workaround)
    for legacy programs that may use functions without declarations.
    kito-cheng committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    db7c38a View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2024

  1. Fix typo

    kito-cheng committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    0726ba1 View commit details
    Browse the repository at this point in the history
  2. Revise 'Landing Pad Relaxation'

    Rephase to make it clearly about it can remove instruction.
    kito-cheng committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    1e21e42 View commit details
    Browse the repository at this point in the history
  3. Revise 'Landing Pad Scheme Relaxation'

    - Drop the restriction of static link
    - Emphasis must be applied to all `R_RISCV_LPAD`
    - GNU property and PLT entries must adjust too.
    kito-cheng committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    5d43b57 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    32688be View commit details
    Browse the repository at this point in the history
  5. Relaxation condition updated based on symbol export to dynamic symbol…

    … table
    
    - Updated the relaxation condition to apply only when the symbol is not
      exported to the dynamic symbol table.
    kito-cheng committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    02546de View commit details
    Browse the repository at this point in the history