This is the mail archive of the 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]

`.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o


 While doing some automatic treatment (awk) of assembler files generated by GCC,
i.e. converting ".code16gcc \n calll fct \n" by ".code16gcc \n lcallw *ptr_fct \n"
I get this strange message (in the subject). It seems to be a warning because it
does not seem to stop the link process, but it is not preceded by a "Warning:"
prefix in stderr.

 The version of ld I am using:
[etienne@localhost gujin]$ /home/etienne/projet/toolchain/bin/ld -v
 GNU ld version 2.16.1 

 The exact modification I ask awk to do (add the 4 following lines):
 1362                         .section        reloc_paramcode_section
 1363                 .weak fptr_linux_set_params
 1364 0000 00000000   fptr_linux_set_params:  .long linux_set_params
 1365                         .previous
 1366                         .section        .paramcode_linux_set_params,"ax",@progbits
 1367                         .p2align 1,,1
 1369                   linux_set_params:
 1370 0000 6655                 pushl   %ebp    #
 1371 0002 6657                 pushl   %edi    #
 1372 0004 6656                 pushl   %esi    #
 1373 0006 6653                 pushl   %ebx    #

 Plus an automatic transform of "call linux_set_params" by
 "lcallw *fptr_linux_set_params".

 I have already tried to use either ".globl fptr_linux_set_params" instead of
 ".weak fptr_linux_set_params".

 My problem is when the function (for instance) linux_set_params is not used
at all in the link process, and is discarded because I am using GCC -ffunction-sections
and LD --gc-sections, it is still referenced in ".section reloc_paramcode_section"
which trigger this message:

[etienne@localhost gujin]$ /home/etienne/projet/toolchain/bin/ld boot.o user.o debug.o
library.o disk.o util.o gzlib.o kbd.o fs.o vmlinuz.o mouse.o main.o font.o   -nostdlib
-Tboot.lnk --sort-common --cref --warn-section-align --no-check-sections
--gc-sections -o boot.elf
/home/etienne/projet/toolchain/bin/ld: `.paramcode_linux_set_params' referenced in
section `reloc_paramcode_section' of vmlinuz.o: defined in discarded section
`.paramcode_linux_set_params' of vmlinuz.o

 Is there a trick to either not create symbol "fptr_linux_set_params:" in section
"reloc_paramcode_section" or not display this message (losing the 4 bytes for this
pointer is not a major problem).

  Thanks a lot,


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

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