This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][GAS/ARM] Better handling of difference between a symbol and an undefined symbol.


This is a little tricky.  I use this test case.

	.section	.data.i
i:
	.long		0

	.section	.data.j
	.long		i - (. - .L1)
.L1:

#objdump: -s -j .data.j
#name: symdiff

# Test difference between a symbol and a not-yet-defined symbol is
# handled properly.

.*:[ ]+file format .*

Contents of section .*:
 0000 (040+|0+4)[ ]+\.\.\.\.[ ]+

This test passes for targets arm-eabi, armeb-eabi, powerpc-elf and
powerpc64-elf.  Unfortunately, it does not work for x86_64, which uses
RELA.  I can split the possibly use different tests for REL and RELA.
However, is there a simple way to tell which target uses which kind of
relocation?

-Doug

在 2010年9月27日下午6:37,Doug Kwan (關振德) <dougkwan@google.com> 寫道:
> Sounds like a good suggestion, I will change the test case then.
>
> 在 2010年9月27日下午6:35,Dave Korn <dave.korn.cygwin@gmail.com> 寫道:
>> On 28/09/2010 00:53, Doug Kwan (關振德) wrote:
>>> Absolutely, I would like to use something like:
>>>
>>>         .section        .data.i,"a"
>>> i:
>>>         .long   0
>>>
>>>         .section        .data.j,"a"
>>> j:
>>>         .long   i - (. - .L1)
>>> .L1:
>>>
>>> The problem is that I cannot guarantee that it assembles for all
>>> targets.  Is there a good way to test that?
>>
>>  I think if you just use a .section directive with only a section name and no
>> flags, that ought to assemble everywhere.  Since it's an assembler-only test
>> that doesn't need a compiler, you can easily run a script that builds and
>> tests binutils for a whole huge list of cross-targets and see whether it fails
>> anywhere.  (I'll send you a copy off-list if you'd like.)
>>
>>    cheers,
>>      DaveK
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]