[U-Boot] [PATCH v2 1/2] RFC: create u-boot-common.lds
Graeme Russ
graeme.russ at gmail.com
Wed Feb 8 03:51:39 CET 2012
Hi Troy,
On Wed, Feb 8, 2012 at 1:46 PM, Troy Kisky
<troy.kisky at boundarydevices.com> wrote:
> On 2/7/2012 7:24 PM, Graeme Russ wrote:
>>
>> The next biggie is where to define all the externs exported from the
>> linker script as a result of using the U_BOOT_LDS_SECTION macro. I'm half
>> tempted to think we could collect all the usages of U_BOOT_LDS_SECTION
>> in a header (for the common case, that is essentially u-boot-common.lds)
>> and by setting a #define you switch between full macro expansion (for
>> the linker) and 'extern generation' for including in C files. That way,
>> when you add a new section, everything happen automagically :)
>>
>> Regards,
>>
>> Graeme
>>
> So do you think this is wrong in patch 2/2?
>
> diff --git a/include/phy.h b/include/phy.h
> index bc522d5..f0eb502 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -23,6 +23,7 @@
> #ifndef _PHY_H
> #define _PHY_H
>
> +#include <linux/compiler.h>
> #include <linux/list.h>
> #include <linux/mii.h>
> #include <linux/ethtool.h>
> @@ -231,4 +232,7 @@ int phy_vitesse_init(void);
> /* PHY UIDs for various PHYs that are referenced in external code */
> #define PHY_UID_TN2020 0x00a19410
>
> +#define __phy_entry __attribute__((section(".phy_entry"))) __used
> __aligned(4)
> +extern struct phy_driver __phy_entry_start, __phy_entry_end;
> +
Aha! Thanks - putting the extern there makes much more sense :)
> #endif
>
>
> I don't see how this can be automatically generated.
Yeah, I wouldn't bother either now I see above
Regards,
Graeme
More information about the U-Boot
mailing list