#!/bin/bash # SPDX-License-Identifier: GPL-2.0-only # objdiff - a small script for validating that a commit or series of commits # didn't change object code. # # Copyright 2014, Jason Cooper # # 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 .objdiff/*) # $ ./scripts/objdiff clean all # # Note: 'make mrproper' will also remove .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/.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 alue='linux-3.14.y'>linux-3.14.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2022-05-07fork: Generalize PF_IO_WORKER handlingEric W. Biederman
2022-05-07fork: Pass struct kernel_clone_args into copy_threadEric W. Biederman
2022-02-25uaccess: fix type mismatch warnings from access_ok()Arnd Bergmann
2021-10-29signal: Replace force_sigsegv(SIGSEGV) with force_fatal_sig(SIGSEGV)Eric W. Biederman
2021-05-10arc: Fix typos/spellosBhaskar Chowdhury
2021-02-21arch: setup PF_IO_WORKER threads like PF_KTHREADJens Axboe
2020-10-05ARC: [plat-eznps]: Drop support for EZChip NPS platformVineet Gupta
2020-08-12mm/gup: remove task_struct pointer for all gup codePeter Xu
2020-08-09Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds
2020-07-27kill unused dump_fpu() instancesAl Viro
2020-07-04arch: rename copy_thread_tls() back to copy_thread()Christian Brauner
2020-06-09mmap locking API: use coccinelle to convert mmap_sem rwsem call sitesMichel Lespinasse
2020-01-17ARCv2: fpu: preserve userspace fpu stateVineet Gupta
2020-01-15ARC: wireup clone3 syscallVineet Gupta
2019-07-08Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...Linus Torvalds
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
2019-05-27signal: Remove task parameter from force_sigEric W. Biederman
2019-05-27signal: Remove task parameter from force_sigsegvEric W. Biederman
2019-01-03Remove 'type' argument from access_ok() functionLinus Torvalds
2018-10-05ARC: clone syscall to setp r25 as thread pointerVineet Gupta
2018-07-09ARC: Improve cmpxchg syscall implementationPeter Zijlstra