Closed yiting16 closed 4 years ago
Thanks for the report.
It is better to resolve the specific target issue in the target related files rather than the generic code. If you modify the generic code, then you have to make sure that your modification won't affect other ports.
I suppose that the default linker script won't cause this problem. See the _bfd_riscv_relax_call
in the bfd/elfnn-riscv.c, we have already consider the maximum alignment for the cross output section boundaries. Your failed case will gather the different input "text" sections with different alignments into the same output section. I'm not sure whether this is a normal usage, but if we need to resolve this, then always consider the max alignment for the call relaxation may be a more suitable way.
Thanks Best Regards Nelson
@Nelson1225 Thank you for your guidance. I understand what you mean. Jim has created a patch, used the max alignment for the call relaxation as you said. So, I will close my pull request.
See bug report at https://sourceware.org/bugzilla/show_bug.cgi?id=25181