From: Etienne Lorrain <etienne_lorrain@yahoo.fr>
To: Alan Modra <amodra@bigpond.net.au>
Cc: binutils@sourceware.org
Subject: Re: `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o
Date: Fri, 19 May 2006 15:57:00 -0000 [thread overview]
Message-ID: <20060519123906.13962.qmail@web26909.mail.ukl.yahoo.com> (raw)
In-Reply-To: <20060519060903.GC22757@bubble.grove.modra.org>
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
next prev parent reply other threads:[~2006-05-19 12:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-16 15:28 Etienne Lorrain
2006-05-16 22:39 ` Alan Modra
2006-05-16 22:47 ` Etienne Lorrain
2006-05-17 11:34 ` Alan Modra
2006-05-17 15:32 ` Fix regression introduced 2006-04-21 Alan Modra
2006-05-17 16:19 ` `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o Etienne Lorrain
2006-05-19 11:50 ` Alan Modra
2006-05-19 15:30 ` Etienne Lorrain
2006-05-19 15:37 ` Alan Modra
2006-05-19 15:57 ` Etienne Lorrain [this message]
2006-05-20 13:56 ` Alan Modra
2006-05-16 22:37 Etienne Lorrain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060519123906.13962.qmail@web26909.mail.ukl.yahoo.com \
--to=etienne_lorrain@yahoo.fr \
--cc=amodra@bigpond.net.au \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).