Shrinking While Linking

(tweag.io)

31 points | by ingve 4 days ago ago

3 comments

  • lionkor 34 minutes ago

    > Back in the day, your compiler or assembler would turn each source file into an “object” file containing the compiled code.

    Lots and lots of code is still C and C++. That's not really "back in the day".

    • dcminter 6 minutes ago

      I'd be very surprised if the C/C++ code being written today was comparable in volume to the collective pile of JavaScript, Java, C#, Go, Python, and PHP.

      Contrast to the heyday of C and C++ when not much else got a look in (Pascal perhaps? Perl probably...)

      I think it's fair.

  • kragen an hour ago

    These are extremely practical tips on using binutils to shrink your libraries. It might also be worthwhile to compile the library without per-function sections in the first place, which hopefully can be done without patching rustc. On many platforms this produces significantly smaller code in GCC.