https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111518
palmer at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |palmer at gcc dot gnu.org
--- Comment #1 from palmer at gcc dot gnu.org ---
(In reply to sattdeepan from comment #0)
> 1. Compile with -z,relro,-z,now flag:
> gcc -g -Wl,-z,norelro -O0 -o test_partial test_relro.c
Those don't match: the comment says relro+now, but the command line says
norelro. I'm just double checking to make sure the run is from a relro+now
build, as opposed to a norelro build.
Also, I get a warning building the code. I don't think it'll result in bad
behavior here, though.
$ riscv64-unknown-linux-gnu-gcc test.c -o test
test.c: In function ‘main’:
test.c:7:35: warning: passing argument 1 of ‘strtol’ from incompatible pointer
type [-Wincompatible-pointer-types]
7 | size_t *p = (size_t *) strtol(argv[1], NULL, 16);
| ~~~~^~~
| |
| int *
In file included from test.c:2:
/usr/riscv64-unknown-linux-gnu/usr/include/stdlib.h:177:48: note: expected
‘const char * restrict’ but argument is of type ‘int *’
177 | extern long int strtol (const char *__restrict __nptr,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~