Recent

Author Topic: Does anyone meet this strange error about generating library in linux?  (Read 650 times)

TYDQ

  • Full Member
  • ***
  • Posts: 102
I was trying to generate an dynamic library without using fpc.cfg and standard library.I want to run bash test.sh to generate the linux dynamic library (*.so) to use as a middle file to generate uefi application by using GenFw(EDK2 provided this tool).However,I discovered that my linux dynamic library linked is too tiny(One of My pascal code files is larger than it,Does my shell code wrong?) to generate an uefi application.my linux dynamic library is only 13.6 kb size,and using every method I can't know its function and entry inside.Does I use fpc command line with mistake?
When I use readelf,it tells me that There are no section groups in this file.
My file is attached in this topic,Everyone who can discover my mistake can download it.
« Last Edit: June 26, 2024, 02:02:36 pm by TYDQ »

TYDQ

  • Full Member
  • ***
  • Posts: 102
If I replace -XXs with -Xs,the library could be bigger but It can't boot when convert elf to efi using GenFw.
Is it the error of fpc -XXs or me?

Thaddy

  • Hero Member
  • *****
  • Posts: 15531
  • Censorship about opinions does not belong here.
You. stripping information from libraries is not a good idea. From executables it is usually OK.
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

TYDQ

  • Full Member
  • ***
  • Posts: 102
You. stripping information from libraries is not a good idea. From executables it is usually OK.
If I add -XX to the fpc,The generated library will be too tiny to be convert.Whenever I add -O- or -O4,Whenever I add -Xs.
So do you have the idea to compile library with reasonable size?

Thaddy

  • Hero Member
  • *****
  • Posts: 15531
  • Censorship about opinions does not belong here.
YOU are resonsible for that: libraries need to be compiled with ALL code in place, otherwise they can not be used. It is a matter of discipline.
So the answer is: write better code and just exclude the debug info. -Xs is not allowed...
« Last Edit: June 26, 2024, 05:54:55 pm by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

TYDQ

  • Full Member
  • ***
  • Posts: 102
YOU are resonsible for that: libraries need to be compiled with ALL code in place, otherwise they can not be used. It is a matter of discipline.
So the answer is: write better code and just exclude the debug info. -Xs is not allowed...
OK,I will try this,if I meet any error,I will report to you.

 

TinyPortal © 2005-2018