Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # link vmlinux |
| 4 | # |
| 5 | # vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_INIT) and |
| 6 | # $(KBUILD_VMLINUX_MAIN). Most are built-in.o files from top-level directories |
| 7 | # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. |
| 8 | # Ordering when linking is important, and $(KBUILD_VMLINUX_INIT) must be first. |
| 9 | # |
| 10 | # vmlinux |
| 11 | # ^ |
| 12 | # | |
| 13 | # +-< $(KBUILD_VMLINUX_INIT) |
| 14 | # | +--< init/version.o + more |
| 15 | # | |
| 16 | # +--< $(KBUILD_VMLINUX_MAIN) |
| 17 | # | +--< drivers/built-in.o mm/built-in.o + more |
| 18 | # | |
| 19 | # +-< ${kallsymso} (see description in KALLSYMS section) |
| 20 | # |
| 21 | # vmlinux version (uname -v) cannot be updated during normal |
| 22 | # descending-into-subdirs phase since we do not yet know if we need to |
| 23 | # update vmlinux. |
| 24 | # Therefore this step is delayed until just before final link of vmlinux. |
| 25 | # |
| 26 | # System.map is generated to document addresses of all kernel symbols |
| 27 | |
| 28 | # Error out on error |
| 29 | set -e |
| 30 | |
| 31 | # Nice output in kbuild format |
| 32 | # Will be supressed by "make -s" |
| 33 | info() |
| 34 | { |
| 35 | if [ "${quiet}" != "silent_" ]; then |
| 36 | printf " %-7s %s\n" ${1} ${2} |
| 37 | fi |
| 38 | } |
| 39 | |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 40 | # Thin archive build here makes a final archive with |
| 41 | # symbol table and indexes from vmlinux objects, which can be |
| 42 | # used as input to linker. |
| 43 | # |
| 44 | # Traditional incremental style of link does not require this step |
| 45 | # |
| 46 | # built-in.o output file |
| 47 | # |
| 48 | archive_builtin() |
| 49 | { |
| 50 | if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then |
| 51 | info AR built-in.o |
| 52 | rm -f built-in.o; |
| 53 | ${AR} rcsT${KBUILD_ARFLAGS} built-in.o \ |
| 54 | ${KBUILD_VMLINUX_INIT} \ |
| 55 | ${KBUILD_VMLINUX_MAIN} |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 56 | |
| 57 | if [ -n "${CONFIG_LTO_CLANG}" ]; then |
| 58 | mv -f built-in.o built-in.o.tmp |
| 59 | ${LLVM_AR} rcsT${KBUILD_ARFLAGS} built-in.o $(${AR} t built-in.o.tmp) |
| 60 | rm -f built-in.o.tmp |
| 61 | fi |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 62 | fi |
| 63 | } |
| 64 | |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 65 | # If CONFIG_LTO_CLANG is selected, collect generated symbol versions into |
| 66 | # .tmp_symversions |
| 67 | modversions() |
| 68 | { |
| 69 | if [ -z "${CONFIG_LTO_CLANG}" ]; then |
| 70 | return |
| 71 | fi |
| 72 | |
| 73 | if [ -z "${CONFIG_MODVERSIONS}" ]; then |
| 74 | return |
| 75 | fi |
| 76 | |
| 77 | rm -f .tmp_symversions |
| 78 | |
| 79 | for a in built-in.o ${KBUILD_VMLINUX_LIBS}; do |
| 80 | for o in $(${AR} t $a); do |
| 81 | if [ -f ${o}.symversions ]; then |
| 82 | cat ${o}.symversions >> .tmp_symversions |
| 83 | fi |
| 84 | done |
| 85 | done |
| 86 | |
| 87 | echo "-T .tmp_symversions" |
| 88 | } |
| 89 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 90 | # Link of vmlinux.o used for section mismatch analysis |
| 91 | # ${1} output file |
| 92 | modpost_link() |
| 93 | { |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 94 | local objects |
| 95 | |
| 96 | if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then |
| 97 | objects="--whole-archive built-in.o" |
| 98 | else |
| 99 | objects="${KBUILD_VMLINUX_INIT} \ |
| 100 | --start-group \ |
| 101 | ${KBUILD_VMLINUX_MAIN} \ |
| 102 | --end-group" |
| 103 | fi |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 104 | |
| 105 | if [ -n "${CONFIG_LTO_CLANG}" ]; then |
| 106 | # This might take a while, so indicate that we're doing |
| 107 | # an LTO link |
| 108 | info LTO vmlinux.o |
| 109 | else |
| 110 | info LD vmlinux.o |
| 111 | fi |
| 112 | |
| 113 | ${LD} ${LDFLAGS} -r -o ${1} $(modversions) ${objects} |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 114 | } |
| 115 | |
Sami Tolvanen | 7bd125e | 2017-06-16 12:52:57 -0700 | [diff] [blame] | 116 | # If CONFIG_LTO_CLANG is selected, we postpone running recordmcount until |
| 117 | # we have compiled LLVM IR to an object file. |
| 118 | recordmcount() |
| 119 | { |
| 120 | if [ -z "${CONFIG_LTO_CLANG}" ]; then |
| 121 | return |
| 122 | fi |
| 123 | |
| 124 | if [ -n "${CONFIG_FTRACE_MCOUNT_RECORD}" ]; then |
| 125 | scripts/recordmcount ${RECORDMCOUNT_FLAGS} $* |
| 126 | fi |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | # Link of vmlinux |
| 130 | # ${1} - optional extra .o files |
| 131 | # ${2} - output file |
| 132 | vmlinux_link() |
| 133 | { |
| 134 | local lds="${objtree}/${KBUILD_LDS}" |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 135 | local objects |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 136 | |
| 137 | if [ "${SRCARCH}" != "um" ]; then |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 138 | local ld=${LD} |
| 139 | local ldflags="${LDFLAGS} ${LDFLAGS_vmlinux}" |
| 140 | |
| 141 | if [ -n "${LDFINAL_vmlinux}" ]; then |
| 142 | ld=${LDFINAL_vmlinux} |
| 143 | ldflags="${LDFLAGS_FINAL_vmlinux} ${LDFLAGS_vmlinux}" |
| 144 | fi |
| 145 | |
| 146 | if [[ -n "${CONFIG_THIN_ARCHIVES}" && -z "${CONFIG_LTO_CLANG}" ]]; then |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 147 | objects="--whole-archive built-in.o ${1}" |
| 148 | else |
| 149 | objects="${KBUILD_VMLINUX_INIT} \ |
| 150 | --start-group \ |
| 151 | ${KBUILD_VMLINUX_MAIN} \ |
| 152 | --end-group \ |
| 153 | ${1}" |
| 154 | fi |
| 155 | |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 156 | ${ld} ${ldflags} -o ${2} -T ${lds} ${objects} |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 157 | else |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 158 | if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then |
| 159 | objects="-Wl,--whole-archive built-in.o ${1}" |
| 160 | else |
| 161 | objects="${KBUILD_VMLINUX_INIT} \ |
| 162 | -Wl,--start-group \ |
| 163 | ${KBUILD_VMLINUX_MAIN} \ |
| 164 | -Wl,--end-group \ |
| 165 | ${1}" |
| 166 | fi |
| 167 | |
| 168 | ${CC} ${CFLAGS_vmlinux} -o ${2} \ |
| 169 | -Wl,-T,${lds} \ |
| 170 | ${objects} \ |
| 171 | -lutil -lrt -lpthread |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 172 | rm -f linux |
| 173 | fi |
| 174 | } |
| 175 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 176 | # Create ${2} .o file with all symbols from the ${1} object file |
| 177 | kallsyms() |
| 178 | { |
| 179 | info KSYM ${2} |
| 180 | local kallsymopt; |
| 181 | |
Rusty Russell | b92021b | 2013-03-15 15:04:17 +1030 | [diff] [blame] | 182 | if [ -n "${CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX}" ]; then |
| 183 | kallsymopt="${kallsymopt} --symbol-prefix=_" |
James Hogan | 6895f97 | 2012-09-06 22:11:25 +0100 | [diff] [blame] | 184 | fi |
| 185 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 186 | if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then |
James Hogan | 6895f97 | 2012-09-06 22:11:25 +0100 | [diff] [blame] | 187 | kallsymopt="${kallsymopt} --all-symbols" |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 188 | fi |
| 189 | |
Ard Biesheuvel | 4d5d566 | 2016-03-15 14:58:12 -0700 | [diff] [blame] | 190 | if [ -n "${CONFIG_KALLSYMS_ABSOLUTE_PERCPU}" ]; then |
Rusty Russell | c6bda7c | 2014-03-17 14:05:46 +1030 | [diff] [blame] | 191 | kallsymopt="${kallsymopt} --absolute-percpu" |
| 192 | fi |
| 193 | |
Ard Biesheuvel | 2213e9a | 2016-03-15 14:58:19 -0700 | [diff] [blame] | 194 | if [ -n "${CONFIG_KALLSYMS_BASE_RELATIVE}" ]; then |
| 195 | kallsymopt="${kallsymopt} --base-relative" |
| 196 | fi |
| 197 | |
Sam Ravnborg | 00e6c28c | 2012-05-08 19:53:46 +0200 | [diff] [blame] | 198 | local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ |
| 199 | ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 200 | |
Ard Biesheuvel | a043934 | 2016-02-05 11:25:05 +0100 | [diff] [blame] | 201 | local afile="`basename ${2} .o`.S" |
| 202 | |
| 203 | ${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile} |
| 204 | ${CC} ${aflags} -c -o ${2} ${afile} |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 205 | } |
| 206 | |
Arun Menon | 12e1b34 | 2017-07-27 10:41:57 -0700 | [diff] [blame] | 207 | # Generates ${2} .o file with RTIC MP's from the ${1} object file (vmlinux) |
| 208 | # ${3} the file name where the sizes of the RTIC MP structure are stored |
| 209 | # just in case, save copy of the RTIC mp to ${4} |
| 210 | # Note: RTIC_MPGEN has to be set if MPGen is available |
| 211 | rtic_mp() |
| 212 | { |
| 213 | # assume that RTIC_MP_O generation may fail |
| 214 | RTIC_MP_O= |
| 215 | |
| 216 | ${RTIC_MPGEN} --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \ |
| 217 | --binpath='' --vmlinux=${1} --config=${KCONFIG_CONFIG} && \ |
| 218 | cat rtic_mp.c | ${CC} -c -o ${2} -x c - && \ |
| 219 | cp rtic_mp.c ${4} && \ |
| 220 | ${NM} --print-size --size-sort ${2} > ${3} && \ |
| 221 | RTIC_MP_O=${2} |
| 222 | # NM - save generated variable sizes for verification |
| 223 | # RTIC_MP_O is our retval - great success if set to generated .o file |
| 224 | } |
| 225 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 226 | # Create map file with all symbols from ${1} |
| 227 | # See mksymap for additional details |
| 228 | mksysmap() |
| 229 | { |
| 230 | ${CONFIG_SHELL} "${srctree}/scripts/mksysmap" ${1} ${2} |
| 231 | } |
| 232 | |
Linus Torvalds | 1347a2ce | 2012-05-28 10:32:28 -0700 | [diff] [blame] | 233 | sortextable() |
| 234 | { |
| 235 | ${objtree}/scripts/sortextable ${1} |
| 236 | } |
| 237 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 238 | # Delete output files in case of error |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 239 | cleanup() |
| 240 | { |
| 241 | rm -f .old_version |
| 242 | rm -f .tmp_System.map |
| 243 | rm -f .tmp_kallsyms* |
| 244 | rm -f .tmp_version |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 245 | rm -f .tmp_symversions |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 246 | rm -f .tmp_vmlinux* |
Stephen Rothwell | a5967db | 2016-08-24 22:29:19 +1000 | [diff] [blame] | 247 | rm -f built-in.o |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 248 | rm -f System.map |
| 249 | rm -f vmlinux |
| 250 | rm -f vmlinux.o |
Arun Menon | 12e1b34 | 2017-07-27 10:41:57 -0700 | [diff] [blame] | 251 | rm -f .tmp_rtic_mp_sz* |
| 252 | rm -f rtic_mp.* |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 253 | } |
| 254 | |
Sylvain BERTRAND | ab160db | 2015-05-07 00:36:04 +0000 | [diff] [blame] | 255 | on_exit() |
| 256 | { |
| 257 | if [ $? -ne 0 ]; then |
| 258 | cleanup |
| 259 | fi |
| 260 | } |
| 261 | trap on_exit EXIT |
| 262 | |
| 263 | on_signals() |
| 264 | { |
| 265 | exit 1 |
| 266 | } |
| 267 | trap on_signals HUP INT QUIT TERM |
| 268 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 269 | # |
| 270 | # |
| 271 | # Use "make V=1" to debug this script |
| 272 | case "${KBUILD_VERBOSE}" in |
| 273 | *1*) |
| 274 | set -x |
| 275 | ;; |
| 276 | esac |
| 277 | |
| 278 | if [ "$1" = "clean" ]; then |
| 279 | cleanup |
| 280 | exit 0 |
| 281 | fi |
| 282 | |
| 283 | # We need access to CONFIG_ symbols |
Michal Marek | 423a815 | 2013-02-25 13:47:53 +0100 | [diff] [blame] | 284 | case "${KCONFIG_CONFIG}" in |
| 285 | */*) |
| 286 | . "${KCONFIG_CONFIG}" |
| 287 | ;; |
| 288 | *) |
| 289 | # Force using a file from the current directory |
| 290 | . "./${KCONFIG_CONFIG}" |
| 291 | esac |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 292 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 293 | # Update version |
| 294 | info GEN .version |
| 295 | if [ ! -r .version ]; then |
| 296 | rm -f .version; |
| 297 | echo 1 >.version; |
| 298 | else |
| 299 | mv .version .old_version; |
| 300 | expr 0$(cat .old_version) + 1 >.version; |
| 301 | fi; |
| 302 | |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 303 | archive_builtin |
| 304 | |
| 305 | #link vmlinux.o |
| 306 | modpost_link vmlinux.o |
| 307 | |
| 308 | # modpost vmlinux.o to check for section mismatches |
| 309 | ${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o |
| 310 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 311 | # final build of init/ |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 312 | ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 313 | |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 314 | if [ -n "${CONFIG_LTO_CLANG}" ]; then |
| 315 | # Re-use vmlinux.o, so we can avoid the slow LTO link step in |
| 316 | # vmlinux_link |
| 317 | KBUILD_VMLINUX_INIT= |
| 318 | KBUILD_VMLINUX_MAIN=vmlinux.o |
Sami Tolvanen | 7bd125e | 2017-06-16 12:52:57 -0700 | [diff] [blame] | 319 | |
| 320 | # Call recordmcount if needed |
| 321 | recordmcount vmlinux.o |
Sami Tolvanen | 475bdd7 | 2017-11-28 08:48:49 -0800 | [diff] [blame] | 322 | fi |
| 323 | |
Arun Menon | 12e1b34 | 2017-07-27 10:41:57 -0700 | [diff] [blame] | 324 | # Generate RTIC MP placeholder compile unit of the correct size |
| 325 | # and add it to the list of link objects |
| 326 | # this needs to be done before generating kallsyms |
| 327 | if [ ! -z ${RTIC_MPGEN+x} ]; then |
| 328 | rtic_mp vmlinux.o rtic_mp.o .tmp_rtic_mp_sz1 .tmp_rtic_mp1.c |
| 329 | KBUILD_VMLINUX_MAIN+=" " |
| 330 | KBUILD_VMLINUX_MAIN+=$RTIC_MP_O |
| 331 | fi |
| 332 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 333 | kallsymso="" |
| 334 | kallsyms_vmlinux="" |
| 335 | if [ -n "${CONFIG_KALLSYMS}" ]; then |
| 336 | |
| 337 | # kallsyms support |
| 338 | # Generate section listing all symbols and add it into vmlinux |
| 339 | # It's a three step process: |
| 340 | # 1) Link .tmp_vmlinux1 so it has all symbols and sections, |
| 341 | # but __kallsyms is empty. |
| 342 | # Running kallsyms on that gives us .tmp_kallsyms1.o with |
| 343 | # the right size |
| 344 | # 2) Link .tmp_vmlinux2 so it now has a __kallsyms section of |
| 345 | # the right size, but due to the added section, some |
| 346 | # addresses have shifted. |
| 347 | # From here, we generate a correct .tmp_kallsyms2.o |
| 348 | # 2a) We may use an extra pass as this has been necessary to |
| 349 | # woraround some alignment related bugs. |
| 350 | # KALLSYMS_EXTRA_PASS=1 is used to trigger this. |
| 351 | # 3) The correct ${kallsymso} is linked into the final vmlinux. |
| 352 | # |
| 353 | # a) Verify that the System.map from vmlinux matches the map from |
| 354 | # ${kallsymso}. |
| 355 | |
| 356 | kallsymso=.tmp_kallsyms2.o |
| 357 | kallsyms_vmlinux=.tmp_vmlinux2 |
| 358 | |
| 359 | # step 1 |
| 360 | vmlinux_link "" .tmp_vmlinux1 |
| 361 | kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o |
| 362 | |
| 363 | # step 2 |
| 364 | vmlinux_link .tmp_kallsyms1.o .tmp_vmlinux2 |
| 365 | kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o |
| 366 | |
| 367 | # step 2a |
| 368 | if [ -n "${KALLSYMS_EXTRA_PASS}" ]; then |
| 369 | kallsymso=.tmp_kallsyms3.o |
| 370 | kallsyms_vmlinux=.tmp_vmlinux3 |
| 371 | |
| 372 | vmlinux_link .tmp_kallsyms2.o .tmp_vmlinux3 |
| 373 | |
| 374 | kallsyms .tmp_vmlinux3 .tmp_kallsyms3.o |
| 375 | fi |
| 376 | fi |
| 377 | |
Arun Menon | 12e1b34 | 2017-07-27 10:41:57 -0700 | [diff] [blame] | 378 | # Update RTIC MP object by replacing the place holder |
| 379 | # with actual MP data of the same size |
| 380 | # Also double check that object size did not change |
| 381 | if [ ! -z ${RTIC_MPGEN+x} ]; then |
| 382 | rtic_mp "${kallsyms_vmlinux}" rtic_mp.o .tmp_rtic_mp_sz2 \ |
| 383 | .tmp_rtic_mp2.c |
| 384 | if ! cmp -s .tmp_rtic_mp_sz1 .tmp_rtic_mp_sz2; then |
| 385 | echo >&2 'ERROR: RTIC MP object files size mismatch' |
| 386 | exit 1 |
| 387 | fi |
| 388 | fi |
| 389 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 390 | info LD vmlinux |
| 391 | vmlinux_link "${kallsymso}" vmlinux |
| 392 | |
Linus Torvalds | 1347a2ce | 2012-05-28 10:32:28 -0700 | [diff] [blame] | 393 | if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then |
| 394 | info SORTEX vmlinux |
| 395 | sortextable vmlinux |
| 396 | fi |
| 397 | |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 398 | info SYSMAP System.map |
| 399 | mksysmap vmlinux System.map |
| 400 | |
| 401 | # step a (see comment above) |
| 402 | if [ -n "${CONFIG_KALLSYMS}" ]; then |
| 403 | mksysmap ${kallsyms_vmlinux} .tmp_System.map |
| 404 | |
| 405 | if ! cmp -s System.map .tmp_System.map; then |
Michal Marek | 5369f55 | 2012-07-07 23:04:40 +0200 | [diff] [blame] | 406 | echo >&2 Inconsistent kallsyms data |
Michal Marek | 367e43c | 2012-08-10 11:55:11 +0200 | [diff] [blame] | 407 | echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround |
Sam Ravnborg | 1f2bfbd | 2012-05-05 10:18:41 +0200 | [diff] [blame] | 408 | exit 1 |
| 409 | fi |
| 410 | fi |
| 411 | |
| 412 | # We made a new kernel - delete old version file |
| 413 | rm -f .old_version |