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: `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o


  Sorry, I may have talk a bit too quickly:

 I am now trying to get rid of the unused sections (i.e. functions by having one
reloc_text_section_x per function) by the linker "ld --gc-sections", and after few
modifications I now get this similar message:

`.text.memcpy' referenced in section `reloc_text_section_0' of tmp.o: defined in
discarded section `.text.memcpy' of tmp.o

 Testcase at end, just an intermediate question: Is there another way to handle
the relocation I am doing - do I bother for a problem already solved hundreds of
time already? I feel like reinventing the weel (how about a square one today?).

  Thanks,
  Etienne.

etienne@cygne:~/projet$ cat tmp.s
        .code16gcc
        .psize 0
        .section        reloc_text_section_0
.weak fptr_memcpy
fptr_memcpy:    .long memcpy
        .previous
        .section        .text.memcpy,"ax",@progbits
        .p2align 1,,1
#awk .globl memcpy
        .type   memcpy, @function
memcpy:
        pushl   %ebx    #
        movl    16(%esp), %ebx  # nb, nb
        movl    8(%esp), %ecx   # dest, ivtmp.141
        movl    12(%esp), %edx  # src, ivtmp.143
        jmp     .L4     #
.L5:
        movb    -1(%edx), %al   #, tmp65
        movb    %al, -1(%ecx)   # tmp65,
.L4:
        decl    %ebx    # nb
        incl    %ecx    # ivtmp.141
        incl    %edx    # ivtmp.143
        cmpl    $-1, %ebx       #, nb
        jne     .L5     #,
        popl    %ebx    #
        lretw   $12     #
        .size   memcpy, .-memcpy

etienne@cygne:~/projet$ cat boot.lnk
MEMORY { ram : ORIGIN = 0, LENGTH = 64K }
EXTERN(__ERROR)
SECTIONS {
 .text 0 : AT (0) {
  *(.text*)
  __sizeof_gujin_code_in_text = . ;
  . = ALIGN (32) ;
  _etext = . ;
  } > ram = 0
 .xcode 0 : AT(SIZEOF(.text)) {
  *(.xcode*)
  __sizeof_gujin_code_in_extra = . ;
  . = ALIGN (32) ;
  } > ram = 0
 __sizeof_code = SIZEOF(.text) + SIZEOF(.xcode);
 .xdata 0 : AT(__sizeof_code) {
  . = ALIGN (8);
  __paramcode_start = .;
  *(.paramcode*)
  __sizeof_paramcode = . - __paramcode_start;
  *(.xdata*)
  . = ALIGN (32);
  _exdata = . ;
  __sizeof_xdata = . ;
  } > ram = 0
 .data 0 : AT(__sizeof_code + __sizeof_xdata) {
  *(.fourKsegment*)
  _srodata = . ;
  reloc_text_start = . ;
  *(reloc_text_section_*)
  reloc_text_end = . ;
  reloc_xcode_start = . ;
  *(reloc_xcode_section_*)
  reloc_xcode_end = . ;
  reloc_xdata_start = . ;
  *(reloc_xdata_section_*)
  reloc_xdata_end = . ;
  *(reloc_paramcode_section)
  *(.rodata.str1*)
  *(.rodata*)
  . = ALIGN (32) ;
  _erodata = . ;
  __sizeof_constants = _erodata - _srodata ;
  _end = . ;
  _sdata = . ;
  *(.data)
  . = ALIGN (32);
  _sbss = . ;
  __sizeof_inited_data = _sbss - _sdata ;
  } > ram = 0
 .bss ALIGN(0x10) (NOLOAD) : {
  *(COMMON) *(.bss)
  . = ALIGN (4);
  _edata = . ;
  } > ram = 0
  __sizeof_zeroed_data = SIZEOF (.bss) ;
 .note (NOLOAD) : {
  *(.note)
  }
 .comment (NOLOAD) : {
  *(.comment)
  }
 .stab (NOLOAD) : {
  *(.stab)
  }
 .stabstr (NOLOAD) : {
  *(.stabstr)
  }
 }
NOCROSSREFS (.text .xcode);
EXTERN (xcodeseg_never_call_address_zero);
xcodeseg = SIZEOF(.text) >> 4 ;
_extext = SIZEOF(.xcode);
xdataseg = __sizeof_code >> 4;
deltaseg = (__sizeof_code + SIZEOF(.xdata)) >> 4;
etienne@cygne:~/projet$
etienne@cygne:~/projet$ as tmp.s -o tmp.o
etienne@cygne:~/projet$ /home/etienne/projet/toolchain/bin/ld tmp.o -nostdlib -Tboot.lnk
--no-check-sections --gc-sections -o boot.elf
`.text.memcpy' referenced in section `reloc_text_section_0' of tmp.o: defined in
discarded section `.text.memcpy' of tmp.o
etienne@cygne:~/projet$



	

	
		
___________________________________________________________________________ 
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel. 
Rendez-vous sur http://fr.yahoo.com/set


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