



How to purge out non-used functions from the object file
by dhavalshah on Jun 18, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
I am trying to optimize my code with respect to code size, i am seeing that the objdump file also contains some functions which is never called, some functions are from math library too.
is there anyway (compiler option) to remove this function out automatically by compiler. i used option of --gc-sections , but the gcc compiler says that gc-sections ignored. and i get a large amount of code unused. |
RE: How to purge out non-used functions from the object file
by olof on Jun 18, 2013 |
olof
Posts: 218 Joined: Feb 10, 2010 Last seen: Dec 17, 2018 |
||
Hi,
The current (or32) toolchain based on gcc 4.5.1 lack support for gc-sections. There is however support for gc-sections in the new (or1k) toolchain based on gcc 4.8.0, available from https://github.com/openrisc I'm not completely up to date about what features each toolchain support apart from this, but I have been running the or1k toolchain without problems for a while. There should be build instructions available in the repo or on the openrisc wiki. Best Regards, Olof Kindgren olof@opencores.org |
RE: How to purge out non-used functions from the object file
by dhavalshah on Jun 18, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
Thank you for the reply.
|
-mhard-float option used but still soft-float lib functions are used for math lib functions
by dhavalshah on Jun 18, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
Hi all,
One more question regarding the increase in code size in my case, 1) i am using the option -mhard-float (FPU in hardware). now my single precision floating point operation should be performed by available instruction set. (for e.g lf.add ....) this is okay for the functions i have implemented, but for standard math library function like sinf or cosf it still uses the soft-float library (for e.g __addsf3). which i suppose should not be the case right? also here when i use hard-float , my application goes into exception handler, which i need to dig out the reason first.(running okay with soft-float) 2) what if i dont want any interrupt handler or exception handler in my application, how can i remove them. Thanks in Advance |
RE: How to purge out non-used functions from the object file
by dhavalshah on Jun 19, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
Hi,
The current (or32) toolchain based on gcc 4.5.1 lack support for gc-sections. There is however support for gc-sections in the new (or1k) toolchain based on gcc 4.8.0, available from https://github.com/openrisc I'm not completely up to date about what features each toolchain support apart from this, but I have been running the or1k toolchain without problems for a while. There should be build instructions available in the repo or on the openrisc wiki. Best Regards, Olof Kindgren olof@opencores.org Hi Olof, i was trying to build gcc 4.8, but i had an error in configuring libgcc error was "cannot compute suffix of object file" i have attached config.log file here, can you please suggest what could be wrong? I am sorry if i am asking a basic/vague Question since i am doing ot for first time.pl. tell if you need more information Thanks
config.log (11 kb)
|
RE: How to purge out non-used functions from the object file
by stekern on Jun 20, 2013 |
stekern
Posts: 84 Joined: Apr 28, 2009 Last seen: Nov 10, 2016 |
||
Your config line in the top of the log looks weird, especially the '--host=or1k-elf'.
Did you follow the instructions here? http://opencores.org/or1k/OpenRISC_GNU_tool_chain#Newlib_toolchain_.28or1k-elf.29 Stefan |
RE: How to purge out non-used functions from the object file
by stekern on Jun 20, 2013 |
stekern
Posts: 84 Joined: Apr 28, 2009 Last seen: Nov 10, 2016 |
||
Sorry, I missed that it was the config.log from libgcc, then --host=or1k-elf makes sense.
I thought it was the top-level config.log that you had posted. The question about following the instructions still holds though. |
RE: How to purge out non-used functions from the object file
by dhavalshah on Jun 21, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
Hi Stefan ,
yes i have followed the instruction and this time i got the same error with libstdc++-v3, i am attaching the config file. Awaitng for the reply, thanks in Advance Reagrds Dhaval Shah
config.log (67 kb)
|
RE: How to purge out non-used functions from the object file
by dhavalshah on Jun 25, 2013 |
dhavalshah
Posts: 7 Joined: May 8, 2013 Last seen: Jul 26, 2013 |
||
Hi,
when i am trying to build gcc, following error appears checking for shl_load... configure:error:Link test are not allowed after GCC_NO_EXECUTABLES make[1]*** [configure-target-libstdc++-v3]:error. can someone plesae suggest what could be the problem, Thanks in Advance, Regards |



