rtems-libbsd: M68K linkcmds Patches Galore

Joel Sherrill joel.sherrill at OARcorp.com
Fri Aug 17 14:34:48 UTC 2012


On 08/17/2012 08:46 AM, Ralf Corsepius wrote:
> 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
So he can check that as well. The truth is what gcc actually does.
I produced that list by checking whether printf() in libc was printf
or _printf.
> 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.
Sebastian has successfully converted a number of BSPs over to
shared linker scripts. It is a difficult task but that doesn't make it
impossible.
>> Is this underscore a GNU linker feature or defined in the ABI?
> It's an ABI feature.
>
> Ralf
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel


-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985





More information about the devel mailing list