Annotation of researchv10dc/630/bin/mc68lorder, revision 1.1

1.1     ! root        1: #      COMMON LORDER (modified)
        !             2: #
        !             3: #ident "@(#)lorder:mc68/lorder.sh      1.1"
        !             4: #
        !             5: trap "rm -f /tmp/$$sym?ef; exit" 0 1 2 13 15
        !             6: case $# in
        !             7: 0)     echo usage: mc68lorder file ...
        !             8:        exit ;;
        !             9: 1)     case $1 in
        !            10:        *.o)    set $1 $1
        !            11:        esac
        !            12: esac
        !            13: #      The following sed script is commented here.
        !            14: #      The egrep pipe insures that we only have lines
        !            15: #      that contain file names and the external
        !            16: #      declarations associated with each file.
        !            17: #      The first two parts of the sed script put the pattern
        !            18: #      (in this case the file name) into the hold space
        !            19: #      and creates the "filename filename" lines and
        !            20: #      writes them out. The first part is for .o files,
        !            21: #      the second is for .o's in archives.
        !            22: #      The next 3 sections of code are exactly alike but
        !            23: #      they handle different external symbols, namely the
        !            24: #      symbols that are defined in the text section, data section
        !            25: #      or symbols that are referenced but not defined in this file.
        !            26: #      A line containing the symbol (from the pattern space) and 
        !            27: #      the file it is referenced in (from the hold space) is
        !            28: #      put into the pattern space.
        !            29: #      If its text or data it is written out to the symbol definition
        !            30: #      (symdef) file, otherwise it was referenced but not declared
        !            31: #      in this file so it is written out to the symbol referenced
        !            32: #      (symref) file.
        !            33: #
        !            34: $DMD/bin/mc68nm -e $* | egrep "\\.o:|\\.o]:|\\|extern" |
        !            35:        sed '
        !            36:        /\.o:$/{
        !            37:                s/://
        !            38:                s/^.* //
        !            39:                h
        !            40:                s/.*/& &/
        !            41:                p
        !            42:                d
        !            43:        }
        !            44:        /\.o]:$/{
        !            45:                s/]://
        !            46:                s/^.*\[//
        !            47:                h
        !            48:                s/.*/& &/
        !            49:                p
        !            50:                d
        !            51:        }
        !            52:        /|\.text/{
        !            53:                s/ *|.*//
        !            54:                G
        !            55:                s/\n/ /
        !            56:                w '/tmp/$$symdef'
        !            57:                d
        !            58:        }
        !            59:        /|\.data/{
        !            60:                s/ *|.*//
        !            61:                G
        !            62:                s/\n/ /
        !            63:                w '/tmp/$$symdef'
        !            64:                d
        !            65:        }
        !            66:        s/ *|.*//
        !            67:        G
        !            68:        s/\n/ /
        !            69:        w '/tmp/$$symref'
        !            70:        d
        !            71: '
        !            72: sort /tmp/$$symdef -o /tmp/$$symdef
        !            73: sort /tmp/$$symref -o /tmp/$$symref
        !            74: join /tmp/$$symref /tmp/$$symdef | sed 's/[^ ]* *//'

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.