Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Linker section mapping difference between ARM RVCT and CodeSoucery toolchain


  • To: Lu Karl-B01968 <Karl.Lu@xxxxxxxxxxxxx>
  • Subject: Re: [arm-gnu] Linker section mapping difference between ARM RVCT and CodeSoucery toolchain
  • From: Nick Clifton <nickc@xxxxxxxxxx>
  • Date: Tue, 28 Oct 2008 09:42:20 +0000

Hi Karl,

Now I am using CodeSourcery arm-none-eabi tool chain to compile
application code and link libraries built with ARM RVCT.

For example, RVCT puts all inline
functions into section "i.*" during compilation.

Do you know if there is a way to put
these input sections into ".text" section automatically (don't modify
linker script manually)?

Assuming that:

A. The arm-none-eabi linker is based on a sufficiently recent version of the binutils sources and...

B. You do not mind if the sections are placed in a section next to the .text section in the output file, (rather then actually inside the .text section) then...

You can use the INSERT linker script directive along with the -T linker command line switch to achieve what you want. eg:

  % cat rcvt.inline.linker_script
  SECTIONS
  {
    .text.i{ *(i.*) }
  }
  INSERT BEFORE .text;

% arm-none-eabi-gcc -Wl,-T,rcvt.inline.linker_script <rest-of-gcc-command-line>


An alternative approach is to use the objcopy program to rename the i.* sections. You would have to create a script to scan an object file, extract the names of all of the i.* sections, convert these names into "--rename-section <old>=<new>" command line options and then run objcopy with these options.

Cheers
  Nick