[U-Boot] [PATCH v2] net: ne2000: Divided a function of NE2000 driver
Ben Warren
biggerbadderben at gmail.com
Fri Oct 3 16:14:33 CEST 2008
On Thu, Oct 2, 2008 at 9:39 PM, Nobuhiro Iwamatsu <iwamatsu at nigauri.org> wrote:
> Hi, all
>
> 2008/10/3 Ben Warren <biggerbadderben at gmail.com>:
>> Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 23:07 Wed 01 Oct , Ben Warren wrote:
>>>
>>>> Hi Nobuhiro-san,
>>>>
>>>> Nobuhiro Iwamatsu wrote:
>>>>
>>>>> get_prom function was used __attriute__ , but it is not enable.
>>>>> ax88796.o does not do link besides ne2000.o. When ld is carried
>>>>> out, get_prom function of ax88796.c is ignored.
>>>>> This problem is a thing by specifications of ld.
>>>>> I checked and test this patch on SuperH and MIPS.
>>>>>
>>>>>
>>>> You're seeing a common problem with weak functions - namely that they
>>>> don't always get overridden. If there was a single function in ax88796.c
>>>> that had strong static linkage there wouldn't be a problem. Using the
>>>> weak attribute for get_prom() is an elegant solution that improves code
>>>> re-use, so I'm wondering if there's a way it can be made to work.
>>>>
>>>> If nobody has any suggestions over the next couple of days, I'll pull in
>>>> this patch.
>>>>
>>>> This get_prom() function was set as weak in commit
>>>> 2ef7503a593c77a80c2a054011970227c4b62774, labeled " NE2000: Fix
>>>> regresssion introduced by e710185aae90 on non AX88796" by
>>>> Jean-Christophe PLAGNIOL-VILLARD. It's a shame that this was done
>>>> without testing...
>>>>
>>> The NE2000 is tested every modification and Release on qemu_mips by myself
>>>
>>> And I've no problem on this board.
>>>
>> Sorry, I have a hard time believing that this works if you enable
>> CONFIG_DRIVER_AX88796L. Are you sure that the weak get_prom() is
>> overridden?
>
> Thank you for your check.
>
> When I enabled CONFIG_DRIVER_AX88796L on SH and MIPS, and checked
> ne2000.o by nm,
> get_prom is set in WEAK. But get_prom is not linked, and __get_prom is
> linked in u-boot.
> With the current code, get_prom of AX88796L is not linked.
>
> If need nm and objdump output , I can attach.
>
I believe you. An even easier way to see this is by looking at System.map.
regards,
Ben
More information about the U-Boot
mailing list