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] Utilize Blackfin L1 SRAM


Daniel Jacobowitz wrote:
On Sat, Jul 12, 2008 at 12:50:23AM +0800, Jie Zhang wrote:
Because I think it's much simpler to maintain this option than a processor specific linker script, which is almost as same as the generic one.

But I don't see how it does what you want. LD will still put the code in a segment with some other LMA/VMA. The L1 is what LD calls a region and could be treated as such.

--sep-code is needed when --code-in-l1 is used and there are read only data. I explain further below.

--code-in-l1 and --data-in-l1

They are Blackfin specific options. ld will set EF_BFIN_CODE_IN_L1 or
EF_BFIN_DATA_IN_L1 flag in the output file's elf header flags
respectively. These flags tells loader to put code or data into L1 SRAMs.
Similarly, I'm not sure why file-level ELF flags are right for this.
If you put the input data in the right named sections (e.g. with a
compiler option, or manually) the linker script would do the work.

We have GCC attributes to put functions or data in to L1 SRAMs. But some users don't like to add such attributes to each functions and data in a shared library. They just want to put the whole shared library in L1 SRAMs. So we provide these two options. Compiler option to put data in the right named sections does not help here, since section names of precompiled object files or libraries, which are going to be linked in, cannot be changed.

I think I missed "loader" in this explanation. I'm still confused about the model though. Does it get relocated by whatever loader this is?

Yes. The loader will do relocation when load application or shared library into L1 SRAMs. We use FD-PIC ABI here since Blackfin has no MMU. In FD-PIC ABI, each segment can be relocated independently. In fine grained control, code segment for normal code will be loaded into SDRAM, while code segment for L1 SRAM will be loaded into L1 instruction SRAM. In coarse grained control, all code segment will be loaded into L1 instruction SRAM if EF_BFIN_CODE_IN_L1 is set in ELF header. The situation for data is similar.

The interesting thing is I use specific address like 0xffa00000 to tell loader that the segment should be loaded into L1 instruction SRAM. 0xffa00000 is just a flag not a concrete address. The relocated address might be other than 0xffa00000. The cases for data are similar.


Jie



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