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]

[objcopy] relocation sections


Hello, everyone.
I want to use objcopy to remove the useless sections from the object
file in order the shrink the library. But I can not realize it.
Now I am using libpng for example.
I add -ffunction-sections and -fdata-sections to CFLAGS of the Makefile
as to put every function into its own function.
But when I ran:
$objcopy -R .text.png_read_info pngread.o 
BFD: stXXXXYNYHix: symbol `png_read_info' required but not present
objcopy: stXXXXYNYHix: No symbols
$objcopy -N png_read_info pngread.o
BFD: stXXXX8m8Nnh: symbol `png_read_info' required but not present
objcopy: stXXXX8m8Nnh: No symbols

the comment of the error in bdf/elf.c is as bellow:
/* This case can occur when using --strip-symbol on a symbol
   which is used in a relocation entry.  */
So when I used --strip-all to remove all the symbols and relcation
informations of the object file.
This time the useless sections can be deleted.
But I don't want to remove all the symbols info, and I have no idea what
to do. 
Any suggestions will be appreciated.
Thank you very much.


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