Re: Decreasing size of final executable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2023-06-30 at 09:29 +0200, Jędrzej Dudkiewicz wrote:
> > > Currently I am compiling using the following compiler/linker options:
> > > -fvisibility=hidden -fvisibility-inlines-hidden -flto -Wl,--exclude-libs,ALL
> > > -Wl,-r,--discard-all -Wl,-flto
> > 
> > Hmm, isn't "-r" for partial linking?  How can you use it to link an
> > executable?
> 
> Well, final binary works so I suppose it simply makes no difference.
> Reason for it being here is simple: I've been trying basically all
> combinations of options that according to The Experts Of The Internet
> should somehow make my binary smaller. Since this is combination that
> ended with smallest binary.

I've no idea why it even works in your case.  When I try them for a
Hello World program, the produced "a.out" file is an ELF relocatable and
I cannot run it at all.

-- 
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux