lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <948c31b5-8fc9-4efc-aa75-e25d25f178a2@roeck-us.net>
Date: Wed, 10 Dec 2025 13:54:53 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Alexandre Chartre <alexandre.chartre@...cle.com>,
 "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
 jpoimboe@...nel.org, peterz@...radead.org, david.laight.linux@...il.com
Subject: Re: [PATCH v6 03/30] objtool: Disassemble code with libopcodes
 instead of running objdump

On 12/10/25 10:42, Guenter Roeck wrote:
...
>> That's weird because the "clean" rule in tools/objtool/Makefile should remove the
>> entire tools/objtool/feature directory:
>>
>> $ cat tools/objtool/Makefile
>> ...
>> clean: $(LIBSUBCMD)-clean
>>      $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
>>      $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>>      $(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep
>>      $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
>>      $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool
>>      $(Q)$(RM) -r -- $(OUTPUT)feature
>>
>> see $(Q)$(RM) -r -- $(OUTPUT)feature
>>
> 
> $ find . -name test-disassembler-init-styled*
> ./tools/build/feature/test-disassembler-init-styled.c
> ./tools/objtool/feature/test-disassembler-init-styled.make.output
> ./tools/objtool/feature/test-disassembler-init-styled.d
> $ make clean
>    CLEAN   arch/x86/lib
>    CLEAN   certs
>    CLEAN   arch/x86/entry/vdso
>    CLEAN   init
>    CLEAN   lib/crc
>    CLEAN   arch/x86/tools
>    CLEAN   arch/x86/realmode/rm
>    CLEAN   security/selinux
>    CLEAN   usr
>    CLEAN   .
> $ find . -name test-disassembler-init-styled*
> ./tools/build/feature/test-disassembler-init-styled.c
> ./tools/objtool/feature/test-disassembler-init-styled.make.output
> ./tools/objtool/feature/test-disassembler-init-styled.d
> $
> 
> "make clean" does not execute the cleanup in tools/objtool. I have to run
> "make -C tools/objtool clean". "make mrproper" doesn't clean tools either.
> 
> I guess that is on purpose ?
> 
> Anyway, even "make -C tools/objtool clean" doesn't solve my problem if I build with
> an out-of-tree toolchain. Turns out that, in this case, test-disassembler-init-styled
> is build with binutils from the toolchain (which succeeds because its binutils
> version is more recent). Later on, the actual build of disas.c fails because it uses
> the system toolchain.
> 

This is actually even worse than I thought.

$ git clean -d -x -f -q
$ make defconfig
$ make -j40
$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.c
./tools/objtool/feature/test-disassembler-init-styled.make.output
./tools/objtool/feature/test-disassembler-init-styled.d
$ make -C tools/objtool/ clean
$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.make.output
./tools/build/feature/test-disassembler-init-styled.c
./tools/build/feature/test-disassembler-init-styled.d
$ rm -f ./tools/build/feature/test-disassembler-init-styled.make.output ./tools/build/feature/test-disassembler-init-styled.d
$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.c
$ make -C tools/objtool/ clean
$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.make.output
./tools/build/feature/test-disassembler-init-styled.c
./tools/build/feature/test-disassembler-init-styled.d

Repeated with local toolchain:
$ git clean -d -x -f -q
$ make-x86 defconfig
$ make-x86 -j40
   (fails)
$ make-x86 -C tools/objtool clean
$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.c
./tools/objtool/feature/test-disassembler-init-styled.make.output
./tools/objtool/feature/test-disassembler-init-styled.bin
./tools/objtool/feature/test-disassembler-init-styled.d

So the "make clean" command actually (re-)creates the .bin file. Worse,
if I now run

$ make -C tools/objtool clean

with the system toolchain, the .bin file is not removed.

$ find . -name test-disassembler-init-styled*
./tools/build/feature/test-disassembler-init-styled.make.output
./tools/build/feature/test-disassembler-init-styled.bin
./tools/build/feature/test-disassembler-init-styled.c
./tools/build/feature/test-disassembler-init-styled.d

The local toolchain used in this example is gcc 13.3.0 with binutils 2.42.

Guenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ