Laurent Pinchart laurent.pinchart@skynet.be writes:
I tried the code described above, but it unfortunately doesn't work for all dlls. It returns a correct value in some cases (for small dlls it seems), and a huge negative value around 0xc0000000 in other cases (for bigger dlls).
Most likely the problem is with dlls that aren't properly separated yet. Since they don't use -Bsymbolic _end will resolve to the wrong symbol.
I looked into my old linker script stuff but I'm afraid it won't help in this case. We used it mostly to put the PE header at the right place but the current solution should work just as well for that. So I'd suggest using _end and related symbols, maybe with a configure check, and fall back to some hackish solution for non-separated dlls.