This is the mail archive of the binutils@sources.redhat.com 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: ARM mapping symbols


On Mon, 8 Mar 2004, Richard Earnshaw wrote:

> > Hi Bruno,
> > 
> > >> > The last assembled section is often a data section, so the mapping
> > >> > symbol is $d. Then arm_cleanup is called and the literal pool(s)
> > >> > is(/are) written. As the last symbol already was $d, no new symbol
> > >> > is added... 
> > >> 
> > >> Ok - but this is easily fixed by calling arm_elf_change_section()
> > >> after calling subseg_set() in arm_cleanup().  Then the correct-for-
> > >> that-section mapping symbol will be emitted, which can then be changed
> > >> by your patch to s_ltorg().
> > >
> > > I might be wrong again, but I believe this will add both a $d and a 
> > > $a symbol? 
> > 
> > Yes - is this a problem ?  I know that it is not optimal, but I
> > thought that it might be a simpler "quick hack" that adding a 'forced'
> > argument to mapping_state().
> 
> Please lets not talk about "quick hacks".  Quick hacks have a tendency to 
> breed, and before you know what's happening you have serious spaghetti to 
> untangle.
> 
> Instead, lets work out what needs doing to fix this properly.

Agreed, 

the attached patch solves the problem in a more clean fashion:

* I kept the last mapping symbol for a segment in TC_SEGMENT_INFO_TYPE as 
suggested by Nick
* Added a call to arm_elf_change_section in arm_cleanup as suggested by 
Nick
* I added a mapping state MAP_UNDEFINED as suggested by Richard (this 
avoids duplicate mapping symbols at the start of a section)
* moved the enum to tc-arm.h

* changed
#define md_elf_section_change_hook() arm_elf_change_section
to 
#define md_elf_section_change_hook() arm_elf_change_section()
in tc-arm.h ???????????????? Weird.....

* moved mapstate out of the function so we can change it when changing the 
section

It tested the example given by Richard and literal pools (both explicit 
and implicit) and they appear to work correct.... 


Hope this is acceptable....

Bruno

PS:

I applied for a copyright assignment (but the patch is really small, even 
smaller than the first one)

> R.
> 
> 
> 

Attachment: mapping.patch
Description: Text document


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