Re: [PATCH 2/2] xcoff: implement linker relaxation
pro@helflym.eu
pro@helflym.eu
Wed Apr 20 09:52:27 GMT 2022
Hi Nick,
As I said to the previous patch, I can't do it right now. Thus, if you find a bit of time I woudl be grateful if you can make these changes yourself and apply the patch for me.
Otherwise, maybe Kavana can make the change and push the new patch.
Thansk and sorry for that.
Clément
On Wednesday, April 13, 2022 18:32 CEST, Nick Clifton <nickc@redhat.com> wrote:
Hi Clement,
This patch generates a compile time error (using gcc 11.2.1):
bfd/xcofflink.c: In function 'xcoff_stub_get_csect_in_range':
bfd/xcofflink.c:4332:20: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
4332 | sprintf (buf, "%d", n);
| ^
bfd/xcofflink.c:4332:3: note: 'sprintf' output between 2 and 7 bytes into a destination of size 6
4332 | sprintf (buf, "%d", n);
| ^~~~~~~~~~~~~~~~~~~~~~
I suggest increasing the size of "buf" to at least 8. In addition
if you are feeling paranoid, you could use snprintf instead of
sprintf.
Other than that though the patch looks good to me, so approved,
once that above problem has been fixed.
Cheers
Nick
More information about the Binutils
mailing list