Hi, The patch is fixed some problems as your comments in previous mails. >The assumption that the uleb128 address size can only decrease with relaxation is true only if both addresses are in the same section. I found this kind of subtract is banned in cvt_frag_to_fill for rs_leb128. Therefore, it doesn't have to restrict by ourselves. Thanks for your reviews. Nelson Chu 於 2019年12月18日 週三 上午9:50寫道: > > There is one minor thing. Maciej has pointed out before that it's > better done with one the percent-codes to `_bfd_error_handler' rather > than aborting the link right away, so that any further link errors are > also reported and you don't have to shake them out one by one. So > report the relocation error via linker's callback function seems to be > better. I think maybe we can report a dangerous relocation for the > mismatched R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128. What I meant > is that, > > + case R_RISCV_SET_ULEB128: > ... > + else > + { > + if (uleb128_rel->r_offset != rel->r_offset) > + { > - (*_bfd_error_handler) (_("%pB: relocation %s mismatched. "), > - input_bfd, howto->name); > - bfd_set_error (bfd_error_bad_value); > + msg = ("R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 are mismatched. "); > + r = bfd_reloc_dangerous; > + break; > + } > + relocation = relocation - uleb128_vma; > + uleb128_rel = NULL; > + break; > + } > + > + case R_RISCV_SUB_ULEB128: > + if (uleb128_rel) > + { > + if (uleb128_rel->r_offset != rel->r_offset) > + { > - (*_bfd_error_handler) (_("%pB: relocation %s mismatched. "), > - input_bfd, howto->name); > - bfd_set_error (bfd_error_bad_value); > + msg = ("R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 are mismatched. "); > + r = bfd_reloc_dangerous; > + break; > + } > + relocation = uleb128_vma - relocation; > + uleb128_rel = NULL; > + break; > + } > > Thanks and regards > Nelson -- Best regards, Kuan-Lin Chen. kuanlinchentw@gmail.com