rtems-libbsd: M68K linkcmds Patches Galore
Ralf Corsepius
ralf.corsepius at rtems.org
Fri Aug 17 13:46:54 UTC 2012
On 08/17/2012 03:23 PM, Sebastian Huber wrote:
> On 08/17/2012 03:02 PM, Joel Sherrill wrote:
>>>
>>> Why do we have CPU specific variants of this? On ARM, PowerPC, etc.
>>> this file
>>> would look like identical.
>> Some targets place a leading underscore in front of symbols. If you
>> have every
>> symbol both with and without an extra _ prepended, then it will be Ok.
>> For
>> example,
>> both _bsd__stop_set_sysinit_set and __bsd__stop_set_sysinit_set would
>> have
>> to be defined.
>>
>> This is all the targets I have tools installed for and whether or not
>> they add a
>> leading underscore.
>>
>> arm-rtems4.11 - no leading underscore
>> avr-rtems4.11 - no leading underscore
>> bfin-rtems4.11 - leading underscore
>> h8300-rtems4.11 - leading underscore
>> i386-rtems4.11 - no leading underscore
>> lm32-rtems4.11 - no leading underscore
>> m32c-rtems4.11 - leading underscore
>> m32r-rtems4.11 - no leading underscore
>> m68k-rtems4.11 - no leading underscore
>> microblaze-rtems4.11 - no leading underscore
>> mips-rtems4.11 - no leading underscore
>> powerpc-rtems4.11 - no leading underscore
>> sh-rtems4.11 - leading underscore
>> sparc64-rtems4.11 - no leading underscore
>> sparc-rtems4.11 - no leading underscore
>> v850-rtems4.11 - leading underscore
>
> With this extra underscore can be dealt in the macros that generate
> these symbols.
>
> The CPU port should provide a macro like
>
> #define CPU_LINKER_SYMBOL_NAME(_x) _ ## _x
>
> or
>
> #define CPU_LINKER_SYMBOL_NAME(_x) _x
It's already there: cf. cpukit/score/cpu/<cpu>/*.h
Also GCC internally provides some preprocessor defines to help detecting
them. Unfortunately, for historic reasons, there are cases these defines
are broken.
> Even if we deal with the underscore in the linker command files, then I
> see only two variants and not one for each CPU.
Openly said, I am not sure this currently ongoing effort will be a
success. Several similar attempts in RTEMS history repeatedly had failed.
> Is this underscore a GNU linker feature or defined in the ABI?
It's an ABI feature.
Ralf
More information about the devel
mailing list