some question about output section

loody miloody@gmail.com
Thu May 5 03:00:00 GMT 2011


hi:

2011/5/5 Alan Modra <amodra@gmail.com>:
> On Wed, May 04, 2011 at 11:51:24PM +0800, loody wrote:
>> right? (I thought archive here in document means real folder)
>
> It means what it says.  An archive is a file created by "ar", not
> a directory/folder.
Thank you.
it seems I misunderstand the meaning of "archive" in the document. :P
So I change the script as below:

OUTPUT_ARCH(mips)
SECTIONS
{
  .onlyText 0x80000000 : {  lib2.a:*.o (*.text)  }
}

OUTPUT_ARCH(mips)
SECTIONS
{
  .onlyText 0x80000000 : {  lib2.a: (*.text)  }
}

and link command as:
mipsel-linux-gnu-ld -Bstatic -T ./link.xn -o TEST_LINK.elf -Map
TEST_LINK.map --oformat elf32-tradlittlemips lib2.a

but I still cannot see the section I named in the script file shows up
in final elf.

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .shstrtab         STRTAB          00000000 000034 00001b 00      0   0  1
  [ 2] .symtab           SYMTAB          00000000 0000f0 000010 10      3   1  4
  [ 3] .strtab           STRTAB          00000000 000100 000001 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

below is the content of lib2.a
#nm lib2.a

sdc.o:
0000002c T DRV_SDC_CardStatus_Inserted
0000003c T DRV_SDC_SysInit
00000400 T MOVE_BOOT_CODE_BY_SOFTWARE
0000052c T MOVE_BOOT_CODE_BY_SOFTWARE_With_Setting
         U OS_DelayTime
000000a4 T SDC_CMD0_With_ARG
000000e4 T SDC_InitClock
000001c0 T SDC_ReadSector_Boot
00000000 T _SDC_PowerOn
00000000 b dwClkDivisor
00000014 T Enter
         U inv_dcache_range

-- 
Regards,



More information about the Binutils mailing list