Skip to content

[LLD] getMipsN32RelType parameter type mismatch after scanOne interface change #148346

@autostudiolea

Description

@autostudiolea

@MaskRay

After commit [66c08d9], the scanOne function signature was changed from:

template <class ELFT, class RelTy> void scanOne(RelTy *&i);

to:

template <class ELFT, class RelTy> void scanOne(typename Relocs<RelTy>::const_iterator &i);

However, the getMipsN32RelType function was not updated accordingly, causing a compilation error when !(ELFT::Is64Bits || RelTy::IsCrel) and ctx.arg.mipsN32Abi is true.

In RelocationScanner::scanOne, when the condition constexpr (ELFT::Is64Bits || RelTy::IsCrel) is false and ctx.arg.mipsN32Abi is true, the code calls:

type = getMipsN32RelType(i);

But getMipsN32RelType still expects the old parameter type:

template <class RelTy> RelType getMipsN32RelType(RelTy *&rel) const;

This causes a type mismatch error because i is now of type typename Relocs<RelTy>::const_iterator & instead of RelTy *&.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions