• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãof52fb009085e63da25eeacd39990ac6243ffed76 (tree)
Hora2022-10-27 17:45:43
AutorNelson Chu <nelson@rivo...>
CommiterNelson Chu

Mensagem de Log

RISC-V: Fix build failures for -Werror=sign-compare.

elfnn-riscv.c: In function ‘riscv_relax_resolve_delete_relocs’:
elfnn-riscv.c:4256:30: error: operand of ‘?:’ changes signedness from ‘int’ to ‘unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]

So make the operands unsigned could resolve problem.

bfd/

    • elfnn-riscv.c (riscv_relax_resolve_delete_relocs): Fixed build
      failures for -Werror=sign-compare.

Mudança Sumário

Diff

--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -4239,7 +4239,10 @@ riscv_relax_resolve_delete_relocs (bfd *abfd,
42394239 rel_next = relocs + i;
42404240 if (ELFNN_R_TYPE ((rel_next)->r_info) == R_RISCV_DELETE
42414241 && (rel_next)->r_offset > rel->r_offset)
4242- break;
4242+ {
4243+ BFD_ASSERT (rel_next - rel > 0);
4244+ break;
4245+ }
42434246 else
42444247 rel_next = NULL;
42454248 }
@@ -4253,7 +4256,8 @@ riscv_relax_resolve_delete_relocs (bfd *abfd,
42534256 rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE);
42544257
42554258 /* Skip ahead to the next delete reloc. */
4256- i = rel_next != NULL ? rel_next - relocs - 1 : sec->reloc_count;
4259+ i = rel_next != NULL ? (unsigned int) (rel_next - relocs - 1)
4260+ : sec->reloc_count;
42574261 }
42584262
42594263 return true;