Making generic ld testcases pass on more targets

Nick Clifton nickc@redhat.com
Wed Feb 16 19:48:00 GMT 2005


Hi Alan,

>>>+#ifdef BFD_ASSEMBLER
>>>+  {"dc.a", cons, 0},
>>>+#endif
>>
>>I like this, but why make the pseudo specific to BFD_ASSEMBLERs ?
>
> Because only BFD_ASSEMBLER has arch_info.

Ah - but if we want to use the pseudo in ld testcases then it would need 
to be present for non BFD assemblers as well.

>>>+      nbytes = (stdoutput->arch_info->bits_per_address - 1) / 8;
>>
>>It might make sense to allow for individual targets to override this 
>>computation with their own value if they so wish.
> 
> Yes, that would allow non-BFD_ASSEMBLER to use dc.a too.

OK - this would be my preferred solution.

> Another approach occurred to me also, a variation on using
> __address_size.  Instead of the assembler providing the symbol, we could
> have the test harness feed a suitable --defsym to the assembler, chosen
> by target name.

The problem here is remembering to do this when creating a new target.

Plus it is a duplication of information.  As you have pointed out the 
address size is already in the arch_info structure (for BFD assemblers) 
so why force the developer to put it into the testsuite as well.

Plus it introduces target specific information into a file that might 
otherwise be generic.

Cheers
   Nick




More information about the Binutils mailing list