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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKcpw6U=VW+h4sU1fzrsqXU9z-zVfcFsENKHgAD4paqtndip2w@mail.gmail.com>
Date:   Mon, 6 Apr 2020 18:57:18 +0800
From:   YunQiang Su <wzssyqa@...il.com>
To:     "Maciej W. Rozycki" <macro@...ux-mips.org>
Cc:     Jiaxun Yang <jiaxun.yang@...goat.com>,
        linux-mips <linux-mips@...r.kernel.org>,
        Fangrui Song <maskray@...gle.com>,
        Nathan Chancellor <natechancellor@...il.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] MIPS: malta: Set load address for 32bit kernel correctly

Maciej W. Rozycki <macro@...ux-mips.org> 于2020年4月6日周一 上午1:23写道:
>
> On Mon, 6 Apr 2020, Jiaxun Yang wrote:
>
> > > Given the description above I think it should be done uniformly and
> > >automatically across all platforms by trimming the address supplied
> > >with
> > >$(load-y) to low 8 digits in a single place, that is at the place where
> > >
> > >the variable is consumed.  This will reduce clutter across Makefile
> > >fragments, avoid inconsistencies and extra work to handle individual
> > >platforms as the problem is triggered over and over again, and limit
> > >the
> > >risk of mistakes.
> >
> > I was intended to do like this but failed to find a proper way.
> >
> > Makefile isn't designed for any kind of calculation.
> > And shell variables are 64-bit signed so it can't hold such a huge variable.
> >
> > Just wish somebody can give me a way to do like:
> >
> > ifndef CONFIG_64BIT
> > load-y = $(load-y) & 0xffffffff
> > endif
>
>  Use the usual shell tools like `sed', `cut', `awk', or whatever we use in

perl may be the easiest to use tool here.

ifndef CONFIG_64BIT
  load-y := $(shell $(PERL) -e 'print $(load-y) & 0xffffffff')
endif

Note that it is `:=' instead of '='.

> the kernel build already for other purposes.  There's no need to do any
> actual calculation here to extract the last 8 characters (and the leading
> `0x' prefix).  At worst you can write a small C program, compile it with
> the build system compiler and run, as we already do for some stuff.
>
>   Maciej



-- 
YunQiang Su

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ