#!/bin/bash # objdiff - a small script for validating that a commit or series of commits # didn't change object code. # # Copyright 2014, Jason Cooper # # Licensed under the terms of the GNU GPL version 2 # usage example: # # $ git checkout COMMIT_A # $ # $ ./scripts/objdiff record path/to/*.o # # $ git checkout COMMIT_B # $ # $ ./scripts/objdiff record path/to/*.o # # $ ./scripts/objdiff diff COMMIT_A COMMIT_B # $ # And to clean up (everything is in .tmp_objdiff/*) # $ ./scripts/objdiff clean all # # Note: 'make mrproper' will also remove .tmp_objdiff SRCTREE=$(cd $(git rev-parse --show-toplevel 2>/dev/null); pwd) if [ -z "$SRCTREE" ]; then echo >&2 "ERROR: Not a git repository." exit 1 fi TMPD=$SRCTREE/.tmp_objdiff usage() { echo >&2 "Usage: $0 " echo >&2 " record " echo >&2 " diff " echo >&2 " clean all | " exit 1 } get_output_dir() { dir=${1%/*} if [ "$dir" = "$1" ]; then dir=. fi dir=$(cd $dir; pwd) echo $TMPD/$CMT${dir#$SRCTREE} } do_objdump() { dir=$(get_output_dir $1) base=${1##*/} stripped=$dir/${base%.o}.stripped dis=$dir/${base%.o}.dis [ ! -d "$dir" ] && mkdir -p $dir # remove addresses for a cleaner diff # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and $STRIP -g $1 -R __bug_table -R .note -R .comment -o $stripped $OBJDUMP -D $stripped | sed -e "s/^[[:space:]]\+[0-9a-f]\+//" -e "s:^$stripped:$1:" > $dis } dorecord() { [ $# -eq 0 ] && usage FILES="$*" CMT="`git rev-parse --short HEAD`" STRIP="${CROSS_COMPILE}strip" OBJDUMP="${CROSS_COMPILE}objdump" for d in $FILES; do if [ -d "$d" ]; then for f in $(find $d -name '*.o') do do_objdump $f done else do_objdump $d fi done } dodiff() { [ $# -ne 2 ] && [ $# -ne 0 ] && usage if [ $# -eq 0 ]; then SRC="`git rev-parse --short HEAD^`" DST="`git rev-parse --short HEAD`" else SRC="`git rev-parse --short $1`" DST="`git rev-parse --short $2`" fi DIFF="`which colordiff`" if [ ${#DIFF} -eq 0 ] || [ ! -x "$DIFF" ]; then DIFF="`which diff`" fi SRCD="$TMPD/$SRC" DSTD="$TMPD/$DST" if [ ! -d "$SRCD" ]; then echo >&2 "ERROR: $SRCD doesn't exist" exit 1 fi if [ ! -d "$DSTD" ]; then echo >&2 "ERROR: $DSTD doesn't exist" exit 1 fi $DIFF -Nurd $SRCD $DSTD } doclean() { [ $# -eq 0 ] && usage [ $# -gt 1 ] && usage if [ "x$1" = "xall" ]; then rm -rf $TMPD/* else CMT="`git rev-parse --short $1`" if [ -d "$TMPD/$CMT" ]; then rm -rf $TMPD/$CMT else echo >&2 "$CMT not found" fi fi } [ $# -eq 0 ] && usage case "$1" in record) shift dorecord $* ;; diff) shift dodiff $* ;; clean) shift doclean $* ;; *) echo >&2 "Unrecognized command '$1'" exit 1 ;; esac Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2011-12-06fix apparmor dereferencing potentially freed dentry, sanitize __d_path() APIAl Viro
2011-11-02vfs: add d_prune dentry operationSage Weil
2011-08-06vfs: renumber DCACHE_xyz flags, remove some stale onesLinus Torvalds
2011-07-26atomic: use <linux/atomic.h>Arun Sharma
2011-07-20kill lookup_create()Al Viro
2011-07-20fs: add a DCACHE_NEED_LOOKUP flag for d_flagsJosef Bacik
2011-04-24vfs: get rid of insane dentry hashing rulesLinus Torvalds
2011-03-21FS: lookup_mnt() is only used in the core fs routines nowDavid Howells
2011-03-18lose 'mounting_here' argument in ->d_manage()Al Viro
2011-01-15Allow d_manage() to be used in RCU-walk modeDavid Howells
2011-01-15Add a dentry op to allow processes to be held during pathwalk transitDavid Howells
2011-01-15Add a dentry op to handle automounting rather than abusing follow_link()David Howells
2011-01-10fs: fix dcache.h kernel-doc notationRandy Dunlap
2011-01-07fs: implement faster dentry memcmpNick Piggin
2011-01-07fs: improve scalability of pseudo filesystemsNick Piggin
2011-01-07fs: dcache per-inode inode alias lockingNick Piggin
2011-01-07fs: dcache per-bucket dcache hash lockingNick Piggin
2011-01-07fs: rcu-walk aware d_revalidate methodNick Piggin
2011-01-07fs: cache optimise dentry and inode for rcu-walkNick Piggin
2011-01-07fs: dcache reduce branches in lookup pathNick Piggin
2011-01-07fs: dcache remove d_mountedNick Piggin
2011-01-07fs: rcu-walk for path lookupNick Piggin
2011-01-07fs: dcache rationalise dget variantsNick Piggin
2011-01-07fs: dcache remove dcache_lockNick Piggin
2011-01-07fs: Use rename lock and RCU for multi-step operationsNick Piggin
2011-01-07fs: scale inode alias listNick Piggin
2011-01-07fs: dcache scale subdirsNick Piggin
2011-01-07fs: dcache scale dentry refcountNick Piggin
2011-01-07fs: dcache scale hashNick Piggin
2011-01-07hostfs: simplify lockingNick Piggin
2011-01-07fs: change d_hash for rcu-walkNick Piggin
2011-01-07fs: change d_compare for rcu-walkNick Piggin
2011-01-07fs: name case update methodNick Piggin
2011-01-07fs: change d_delete semanticsNick Piggin
2011-01-07fs: dcache documentation cleanupNick Piggin
2010-08-11vfs: show unreachable paths in getcwd and procMiklos Szeredi
2010-08-09new helper: __dentry_path()Al Viro
2010-05-15Fix the regression created by "set S_DEAD on unlink()..." commitAl Viro