This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [M68K] Fix relocation overflow on ColdFire
- From: Richard Henderson <rth at twiddle dot net>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, libc-ports at sourceware dot org
- Date: Wed, 25 Aug 2010 11:07:53 -0700
- Subject: Re: [M68K] Fix relocation overflow on ColdFire
- References: <4C45D6F4.2070404@codesourcery.com> <m24ofcq2he.fsf@igel.home> <4C7555C5.7070301@codesourcery.com>
On 08/25/2010 10:41 AM, Maxim Kuvyrkov wrote:
> #define SYSCALL_ERROR_LOAD_GOT(reg) \
> - move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, reg; \
> + move.l ##_GLOBAL_OFFSET_TABLE_@GOTPC, reg; \
Both of these are wrong. # is a stringification operator,
and ## is a concatenation operator.
To generate a raw # in a preprocessor macro is tricky.
You have to use an intermediary macro, e.g.
#define HASH #
#define SYSCALL_ERROR_LOAD_GOT(reg) \
move.l HASH _GLOBAL_OFFSET_TABLE_@GOTPC, reg; \
...
and it better be valid assembler to leave a space after the #,
because you can't actually concatenate them without generating
error: pasting "#" and "foo" does not give a valid preprocessing token
r~