Skip to content
Snippets Groups Projects
Select Git revision
  • 30c8e15a462f94ae6fe35e45fa53f1a0087fab3e
  • master default protected
  • 9.0
  • 8.0
  • nt-tools
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2018
  • v8.0.2016
  • v8.0.2014
  • v8.0.2012
  • v8.0.2008
  • v8.0.2006
  • v8.0.2004
  • v8.0.2002
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
41 results

.autodoc_syntax

Blame
  • list-obj-sizes.awk 1.04 KiB
    #! /usr/bin/awk -f
    
    # Run this filter on the output of
    #
    #   objdump -h libnettle.a
    
    function hex2int (hex) {
      n = 0;
      hex = tolower(hex);
      for (i = 1; i<=length(hex); i++)
        {
          n = n * 16 + index("0123456789abcdef", substr(hex,i,1)) - 1;
        }
    
      return n;
    }
    
    BEGIN {
        print "file            text-size  data-size  rodata-size";
        text_total = 0;
        data_total = 0;
        rodata_total = 0;
        name = "";
        filter = ENVIRON["FILTER"];
        if (!filter)
          filter = ".*";
        else
          printf "Filter: %s\n", filter;
    }
    
    /elf32/ {
      if (name)
        {
          printf "%25s %6x   %6x   %6x\n", name, text_size, data_size, rodata_size;
          text_total += text_size;
          data_total += data_size;
          rodata_total += rodata_size; 
        }
      if ($1 ~ filter)
        {
          name = $1; text_size = data_size = rodata_size = 0;
        }
      else
        name = ""
    }
    /\.text/ { text_size = hex2int($3) }
    /\.data/ { data_size = hex2int($3); }
    /\.rodata/ { rodata_size = hex2int($3); }
    
    END {
      printf "%25s %6x   %6x   %6x\n", "TOTAL", text_total, data_total, rodata_total;
    }