lkml.org 
[lkml]   [2018]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] objtool: Ignore retpoline alternatives
On Thu, Jan 11, 2018 at 09:29:48AM -0800, Linus Torvalds wrote:

> Secondly, we use lots of the the "small numbers for local labels" both
> in inline asm and in *.S files.
>
> I think doing
>
> jne 1f
> ...
> 1:
>
> is a _hell_ of a lot more legible than
>
> jne .LPrefix_%
> ...
> .LPrefix_%
>
> unless you have some *major* reason to use an explicit label name.

Small number maybe; but the value at hand was a random 999 or so, which
is not a small number.

But I find a descriptive label ever so much better than a random number.

> Sure, if you grew up writing perl, and think that an illegible mess of
> random characters is a requirement for programming, then the ".L%"
> format looks natural.

I grew up on BASIC and have bad memories of random big number goto. I'll
take those random trailing character any day if it includes human
readable bits before.

> But if you're an actual human, the "small numbers as labels" is fine.

I find descriptive labels much nicer than random numbers, I'll take some
crazy characters if so required.


Consider the retpoline thing:

call .Lset_up_target
.Lcapture_spec:
pause
jmp .Lcapture_spec
.Lset_up_target:
mov %r11, (%rsp);
ret;


over:

call 2f
1:
pause
jmp 1b
2:
mov %r11, (%rsp)
ret


give me the first any day of the week.

\
 
 \ /
  Last update: 2018-01-14 23:24    [W:0.150 / U:1.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site