Issue 148346
Summary [LLD] getMipsN32RelType parameter type mismatch after scanOne interface change
Labels lld
Assignees
Reporter autostudiolea
    @MaskRay 

After commit [66c08d9], the `scanOne` function signature was changed from:
```cpp
template <class ELFT, class RelTy> void scanOne(RelTy *&i);
```
to:
```cpp
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:
```cpp
type = getMipsN32RelType(i);
```

But `getMipsN32RelType` still expects the old parameter type:
```cpp
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 *&`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to