On Mon, 16 Nov 2020 09:43:42 +0100
Fons Adriaensen <fons(a)linuxaudio.org> wrote:
Hello all,
I'm having a strange problem with G++...
In one source file 'fb3data.cc', I define arrays like this:
const float svcoeff44 [216] =
{
1.631996e-03, 6.335480e-02, ...
...
};
(...)
/usr/bin/ld: filtbank3.o: warning: relocation against `svcoeff88'
in
read-only section `.text'
Hi,
I've already seen this strange behavior with gcc 9.x : symbols with
a const definition are by default not publicly visible. It works
if you explicitly add an "extern" in the definition:
extern const float svcoeff44 [216] = (...)
I am not sure whether it is a bug in gcc or a strict application of the
standard.
-a.