This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: dwarf2out var loc handling fix
On Fri, Sep 25, 2009 at 08:58:31PM +0200, Jakub Jelinek wrote:
> The patch just caused that it isn't being thrown away, before it was just a
> latent issue on this testcase.
>
> The same testcase compiled with -g -O2 -fpic fails to link into shared
> library on x86_64 as well:
> /usr/bin/ld: /tmp/cc2r0a6c.o: relocation R_X86_64_PC32 against undefined
> symbol `munmap@@GLIBC_2.2.5' can not be used when making a shared object; /recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
>
> While it e.g. links on i386, the relocation against munmap is lost (the
> linker doesn't create .reloc.debug_info with the relocations that still
> haven't been applied) and so the const value is 0.
>
> I guess we'll need to limit here to symbols emitted in the current
> translation unit.
Shorter testcase:
typedef __SIZE_TYPE__ size_t;
extern "C" int munmap (void *, size_t) throw ();
template <typename U, typename V>
static inline int
bar (int (*x) (U, V), void *y, size_t z)
{
return x ((U) y, (V) z);
}
void *ptr;
long len;
void
foo ()
{
bar (munmap, ptr, len);
}
Please file a bug.
Jakub