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

1.28.0 #169

Merged
merged 7 commits into from
Aug 9, 2024
Merged

1.28.0 #169

merged 7 commits into from
Aug 9, 2024

Conversation

AngheloAlf
Copy link
Member

[1.28.0] - 2024-08-09

Added

  • New SectionText.gpRelHack setting.
    • Turning it on changes all instructions that use a %gp_rel reloc into macro
      instructions that do not specify the relocation explicitly nor reference the
      $gp register.
    • This may even change some instruction mnemonics, like replacing addiu into
      la.
    • This is required by old assemblers that do not support explicit %gp_rel
      relocations, but instead they infer the relocation to be used by checking
      if the symbol was defined in the assembly file and its size fits on the
      passed -G parameter.
    • WARNING: It is the user's responsability to provide those symbol definitions
      to the assembler, otherwise those instructions will be expanded into
      multiple instructions and produce a shifted build.
  • elfObjDisasm's readelf:
    • Add MIPS_SCOMMON and MIPS_SUNDEFINED support in symtab.
    • Use the section name in the ndx column instead of a plain number for
      OBJECTs and FUNCs.

Changed

  • Try to detect function pointers used on tail call optimizations and try to not
    confuse them with detected jumptables.
  • rabbitizer 1.12.0 or above is required.

Fixed

  • Fix rodata addresses referenced only by other rodata symbols on the same
    file not being properly symbolized.
  • elfObjDisasm's readelf:
    • Fix name column not displaying the section's name.
    • Fix relocation sections not displaying anything on the name columns for
      relocations relative to a section instead of a symbol.

…x name column not displaying the section's name
…or relocations relative to a section instead of a symbol.
…ry to not confuse them with detected jumptables.
Get rid of `%gp_rel` and `$gp` since old assemblers don't support `%gp_rel`.

We convert the explicit instructions with relocations into macro/pseudo
instructions and hope for the assembler to do the right thing.

A few examples for the conversions (right being the macro instructions):
`lw     $v0, %gp_rel(example_var)($gp)` -> `lw     $v0, (example_var)`
`addiu  $v0, $gp, %gp_rel(example_var)` -> `la     $v0, (example_var)`

Those assemblers will actually assemble those macro instructions into the
proper ones with gp_rel relocations only if they can also see the symbol
defined on the same assembly file and its size fits within the passed `-G`
parameter. It is the user's responsability to provide those definitions to
the assembler.
@AngheloAlf AngheloAlf merged commit 2b602b8 into master Aug 9, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant