[patch] Add bfd_target_info function to bfd and unify windres/windmc target information gathering
Kai Tietz
ktietz70@googlemail.com
Sat Nov 14 11:02:00 GMT 2009
Hi Nick,
2009/11/12 Nick Clifton <nickc@redhat.com>:
> Hi Kai,
>
>> Well, this was the reason, why I put the target_name check within this
>> function. I wanted to avoid multiple patterns of the form
>>
>> bfd_target *t = bfd_find_target (my_target, NULL);
>> if (!t) error out
>> my_store_symbol_prefix = t->symbol_prefix;
>>
>> ....
>>
>> As most of the bfd helper macros here depend on an existing bfd *. But
>> a bfd * is at some points not present (eg windres tool and windmc), so
>> a function to gather those information by a common function is better
>> then re-implementing again and again.
>
> OK, that is fair. In which case lets go with your original plan for the
> function.
>
> Cheers
> Nick
Ok, here is the updated patch.
ChangeLog for bfd
2009-11-14 Kai Tietz <kai.tietz@onevision.com>
* targets.c (bfd_get_target_info): New function.
(_bfd_find_arch_match): New function.
* bfd-in2.h: Regenerated.
ChangeLog for binutils
2009-11-14 Kai Tietz <kai.tietz@onevision.com>
* windmc.c (set_endianess): Use bfd_get_target_info.
* windres.c (set_endianess): Likewise.
(find_arch_match): Removed.
Tested for i686-pc-mingw32, i686-pc-cygwin, and x86_64-pc-mingw32. Ok for apply?
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd_target_info.diff
Type: application/octet-stream
Size: 7820 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20091114/2b7d8bec/attachment.obj>
More information about the Binutils
mailing list