[CFR] mge driver / elf reloc

Fabien Thomas fabient at freebsd.org
Tue Jul 22 07:38:00 UTC 2014


>> 
>> The original message said why…
> 
> I personally think the original code should unconditionally call load_ptr() and store_ptr()
> and if the optimization for aligned access is actually worth doing, the test for it should be
> in those functions rather than inline throughout the code. The code will be clearer, and
> it would be easier to optimize those cases that actually matter.
> 
> I’m frankly surprised that these relocations are being generated unaligned. Perhaps that’s
> the real bug here that should be fixed. While I’m OK with the original patch (subject to the
> above), I’d be curious what other cases there are for this functionality. You had said that
> you had additional use cases in the network stack, but I’m having trouble groking the
> use cases.

The problem was two years ago but if I remember correctly the module used a packed structure
with function pointer inside (at least).

The fix came from NetBSD:
http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5/src/libexec/ld.elf_so/arch/arm/mdreloc.c
http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5/src/libexec/ld.elf_so/arch/mips/mips_reloc.c

> 
> If this is a huge deal, then defining functions to do this is trivial. I’m just not sure it is common
> enough to need a special macro/function call in the base.
> 
> Warner



More information about the freebsd-arm mailing list