Hi, Peter,
 
The  bigger  code problem in your case is caused by GCC4 inlining some
functions by default. For example, an non-static inline function, that
is  used  only  a  single  time  (such  as  init_SPI in your case), is
included  in the object file twice (the function itself and its inline
call).  If  you specify the -ffunction-sections attribute (and use the
-gc-sections linker switch), the code size will be less than using GCC
v3.

If  you  don't want to use the -ffunction-sections, you either need to
disable  inlining  completely  (-fno-inline),  or  tweak  the  maximum
inlined  function  size  (-finline-limit=x),  that  is  more  precise.

-- 
Best regards,
 Ivan Shcherbakov                     mailto:[email protected]
 TU Kaiserslautern, Germany
 Department of Real-Time Systems


Reply via email to