https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117201
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #6)
> Created attachment 59385 [details]
> test_qrencode.c
With this version, if we do:
```
--- a/tests/test_qrencode.c
+++ b/tests/test_qrencode.c
@@ -16,7 +16,7 @@ static void test_01234567(void) {
0xc0, 0xc0, 0xc0, 0xc1, 0xc0, 0x84, 0x03, 0x03, 0x03, 0x03, 0xc0, 0xc1,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0,
0xc1, 0xc0, 0x85, 0x02, 0x02, 0x02, 0x02, 0xc0, 0xc1, 0xc0, 0xc1, 0xc1,
- 0xc1, 0xc0, 0xc1, 0xc1, 0xc0, 0xc1
+ 0xc1, 0xc0, 0xc1, 0xc1, 0xc0,
};
if (correct[0] != 0xc1) {
```
... then we get a link error like in PR117199:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/cc4TnjAb.ltrans0.ltrans.o: warning: relocation against `.LC1' in read-only
section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/cc4TnjAb.ltrans0.ltrans.o: in function `test_01234567':
<artificial>:(.text+0xaa): undefined reference to `.LC1'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
<artificial>:(.text+0xb1): undefined reference to `.LC1'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
<artificial>:(.text+0xc0): undefined reference to `.LC1'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
<artificial>:(.text+0xc7): undefined reference to `.LC1'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
<artificial>:(.text+0xd6): undefined reference to `.LC1'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/cc4TnjAb.ltrans0.ltrans.o:<artificial>:(.text+0xdd): more undefined
references to `.LC1' follow
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
read-only segment has dynamic relocations
```