linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Alexander Lobakin <alobakin@pm.me>
Cc: Fangrui Song <maskray@google.com>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	linux-mips@vger.kernel.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: Re: [BUG mips llvm] MIPS: malformed R_MIPS_{HI16,LO16} with LLVM
Date: Tue, 12 Jan 2021 14:14:58 -0800	[thread overview]
Message-ID: <CAKwvOdnvd1NaBQEJ0fPsYiGff4=tUdrcuAR0no9FUMqnOZSu6Q@mail.gmail.com> (raw)
In-Reply-To: <20210111204936.17905-1-alobakin@pm.me>

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

On Mon, Jan 11, 2021 at 12:50 PM Alexander Lobakin <alobakin@pm.me> wrote:
>
> > The disassembly for me produces:
> >     399c: 3c 03 00 00   lui     $3, 0 <phy_device_free>
> >                         0000399c:  R_MIPS_HI16  .text
> > ...
> >     39a8: 24 63 3a 5c   addiu   $3, $3, 14940 <phy_probe>
> >                         000039a8:  R_MIPS_LO16  .text
>
> So, in your case the values of the instructions that relocs refer are:
>
> 0x3c030000 R_MIPS_HI16
> 0x24633a5c R_MIPS_LO16
>
> Mine were:
>
> 0x3c010000
> 0x24339444
>
> Your second one doesn't have bit 15 set, so I think this pair won't
> break the code.
> Try to hunt for R_MIPS_LO16 that have this bit set, i.e. they have
> '8', '9', 'a', 'b', 'c', 'd' or 'e' as their [15:12].

I don't think any of my R_MIPS_LO16 in that file have that bit set.
See attached.
-- 
Thanks,
~Nick Desaulniers

[-- Attachment #2: drivers_net_phy_phy_device.objdump.txt --]
[-- Type: text/plain, Size: 6145 bytes --]

			0000004c:  R_MIPS_LO16	kmalloc_caches
			00000088:  R_MIPS_LO16	.data
			00000098:  R_MIPS_LO16	.data
			0000010c:  R_MIPS_LO16	kmalloc_caches
			00000130:  R_MIPS_LO16	$.str
			0000014c:  R_MIPS_LO16	.data
			0000015c:  R_MIPS_LO16	.data
			000001c4:  R_MIPS_LO16	kmalloc_caches
			00000204:  R_MIPS_LO16	.data
			00000214:  R_MIPS_LO16	.data
			00000290:  R_MIPS_LO16	.data
			000002a0:  R_MIPS_LO16	.data
			000002a4:  R_MIPS_LO16	.data
			00000384:  R_MIPS_LO16	.data
			00000394:  R_MIPS_LO16	.data
			00000398:  R_MIPS_LO16	.data
			000003ac:  R_MIPS_LO16	$.str
			00000474:  R_MIPS_LO16	.data
			00000484:  R_MIPS_LO16	.data
			00000488:  R_MIPS_LO16	.data
			0000055c:  R_MIPS_LO16	kmalloc_caches
			00000588:  R_MIPS_LO16	mdio_bus_type
			000005a4:  R_MIPS_LO16	.text
			000005a8:  R_MIPS_LO16	.text
			000005ac:  R_MIPS_LO16	.text
			000005b4:  R_MIPS_LO16	.rodata
			00000638:  R_MIPS_LO16	$.str.1
			0000065c:  R_MIPS_LO16	$.str.2
			00000664:  R_MIPS_LO16	.sbss
			00000684:  R_MIPS_LO16	delayed_work_timer_fn
			00000688:  R_MIPS_LO16	phy_state_machine
			00000998:  R_MIPS_LO16	$.str.62
			000009f8:  R_MIPS_LO16	$.str.63
			00000a50:  R_MIPS_LO16	__stack_chk_guard
			00000d84:  R_MIPS_LO16	__stack_chk_guard
			00000e3c:  R_MIPS_LO16	$.str.3
			00000e4c:  R_MIPS_LO16	$.str.4
			00000ea4:  R_MIPS_LO16	.data
			00000eb4:  R_MIPS_LO16	.data
			00000eb8:  R_MIPS_LO16	.data
			00000ed0:  R_MIPS_LO16	$.str
			00001164:  R_MIPS_LO16	.text
			000011ac:  R_MIPS_LO16	$.str.19
			000011c8:  R_MIPS_LO16	$.str.18
			000011f4:  R_MIPS_LO16	genphy_c45_driver
			000011fc:  R_MIPS_LO16	.data
			00001280:  R_MIPS_LO16	.data
			000013e4:  R_MIPS_LO16	$.str.15
			00001404:  R_MIPS_LO16	$.str.16
			00001444:  R_MIPS_LO16	$.str.14
			0000145c:  R_MIPS_LO16	$.str.17
			00001478:  R_MIPS_LO16	$.str.64
			000014c0:  R_MIPS_LO16	mdio_bus_type
			000014c8:  R_MIPS_LO16	device_match_name
			00001568:  R_MIPS_LO16	$.str.5
			000015f4:  R_MIPS_LO16	__stack_chk_guard
			00001624:  R_MIPS_LO16	$.str.18
			0000162c:  R_MIPS_LO16	$.str.19
			00001648:  R_MIPS_LO16	.data
			00001660:  R_MIPS_LO16	.rodata
			00001668:  R_MIPS_LO16	.rodata
			0000170c:  R_MIPS_LO16	.data
			0000173c:  R_MIPS_LO16	genphy_c45_driver
			00001794:  R_MIPS_LO16	__stack_chk_guard
			00001900:  R_MIPS_LO16	__stack_chk_guard
			00001930:  R_MIPS_LO16	$.str.7
			0000193c:  R_MIPS_LO16	$.str.6
			00001944:  R_MIPS_LO16	$.str.8
			0000195c:  R_MIPS_LO16	$.str.9
			00001984:  R_MIPS_LO16	$.str.10
			0000198c:  R_MIPS_LO16	$.str.11
			00001998:  R_MIPS_LO16	$.str.12
			000019b0:  R_MIPS_LO16	__stack_chk_guard
			00001a10:  R_MIPS_LO16	__stack_chk_guard
			00001a1c:  R_MIPS_LO16	$.str.10
			00001a24:  R_MIPS_LO16	$.str.11
			00001a50:  R_MIPS_LO16	$.str.7
			00001a5c:  R_MIPS_LO16	$.str.6
			00001a64:  R_MIPS_LO16	$.str.8
			00001a80:  R_MIPS_LO16	$.str.9
			00001ab0:  R_MIPS_LO16	$.str.12
			00001ae0:  R_MIPS_LO16	$.str.13
			00001b0c:  R_MIPS_LO16	__stack_chk_guard
			00001b5c:  R_MIPS_LO16	__stack_chk_guard
			00001b88:  R_MIPS_LO16	$.str.7
			00001b94:  R_MIPS_LO16	$.str.6
			00001b9c:  R_MIPS_LO16	$.str.8
			00001bb4:  R_MIPS_LO16	$.str.9
			00001bc4:  R_MIPS_LO16	__stack_chk_guard
			00001d60:  R_MIPS_LO16	mdio_bus_type
			00001d68:  R_MIPS_LO16	device_match_name
			00001dec:  R_MIPS_LO16	$.str.5
			00001e34:  R_MIPS_LO16	.data
			00001e90:  R_MIPS_LO16	genphy_c45_driver
			00001f70:  R_MIPS_LO16	kmalloc_caches
			000020dc:  R_MIPS_LO16	.text
			00002218:  R_MIPS_LO16	__stack_chk_guard
			00002224:  R_MIPS_LO16	.rodata
			00002248:  R_MIPS_LO16	.rodata
			000022d0:  R_MIPS_LO16	__stack_chk_guard
			00002658:  R_MIPS_LO16	.rodata
			00002870:  R_MIPS_LO16	$.str.66
			00002c88:  R_MIPS_LO16	$.str.21
			00002ca0:  R_MIPS_LO16	$.str.20
			00003218:  R_MIPS_LO16	$.str.67
			00003220:  R_MIPS_LO16	$__func__.phy_poll_reset
			000033fc:  R_MIPS_LO16	__stack_chk_guard
			00003474:  R_MIPS_LO16	__stack_chk_guard
			000034c0:  R_MIPS_LO16	__stack_chk_guard
			00003510:  R_MIPS_LO16	__stack_chk_guard
			00003628:  R_MIPS_LO16	__stack_chk_guard
			00003688:  R_MIPS_LO16	__stack_chk_guard
			00003778:  R_MIPS_LO16	__stack_chk_guard
			00003790:  R_MIPS_LO16	$.str.22
			000037d0:  R_MIPS_LO16	$.str.23
			000038c0:  R_MIPS_LO16	__stack_chk_guard
			00003904:  R_MIPS_LO16	$.str.24
			00003920:  R_MIPS_LO16	$.str.25
			00003938:  R_MIPS_LO16	__stack_chk_guard
			000039a4:  R_MIPS_LO16	mdio_bus_type
			000039a8:  R_MIPS_LO16	.text
			000039ac:  R_MIPS_LO16	.text
			000039b0:  R_MIPS_LO16	.text
			00003a18:  R_MIPS_LO16	$.str.28
			00003a30:  R_MIPS_LO16	$.str.26
			00003a50:  R_MIPS_LO16	$.str.27
			00003a78:  R_MIPS_LO16	__stack_chk_guard
			00003c84:  R_MIPS_LO16	__stack_chk_guard
			00003e9c:  R_MIPS_LO16	$.str.31
			00003ee4:  R_MIPS_LO16	.rodata
			00003f00:  R_MIPS_LO16	$.str.33
			00003f08:  R_MIPS_LO16	$.str.59
			00003f10:  R_MIPS_LO16	$.str.34
			00003f3c:  R_MIPS_LO16	$.str.61
			00003f78:  R_MIPS_LO16	__stack_chk_guard
			00004014:  R_MIPS_LO16	.rodata
			00004038:  R_MIPS_LO16	.rodata
			000040ec:  R_MIPS_LO16	__stack_chk_guard
			000042e8:  R_MIPS_LO16	$.str.61
			00000010:  R_MIPS_LO16	genphy_c45_driver
			0000001c:  R_MIPS_LO16	.data
			00000028:  R_MIPS_LO16	.rodata
			00000030:  R_MIPS_LO16	phy_basic_t1_features
			00000044:  R_MIPS_LO16	phy_gbit_features
			00000048:  R_MIPS_LO16	phy_gbit_fibre_features
			00000054:  R_MIPS_LO16	phy_gbit_all_ports_features
			00000060:  R_MIPS_LO16	phy_10gbit_features
			00000074:  R_MIPS_LO16	phy_10gbit_full_features
			00000084:  R_MIPS_LO16	phy_basic_t1_features
			00000090:  R_MIPS_LO16	phy_basic_features
			00000098:  R_MIPS_LO16	phy_basic_features
			0000009c:  R_MIPS_LO16	phy_basic_t1_features
			000000a4:  R_MIPS_LO16	phy_gbit_features
			000000a8:  R_MIPS_LO16	phy_gbit_fibre_features
			000000ac:  R_MIPS_LO16	phy_gbit_all_ports_features
			000000b0:  R_MIPS_LO16	phy_10gbit_features
			000000b8:  R_MIPS_LO16	phy_10gbit_full_features
			000000c0:  R_MIPS_LO16	phy_10gbit_fec_features
			000000cc:  R_MIPS_LO16	phy_10gbit_fec_features
			000000d4:  R_MIPS_LO16	genphy_c45_driver
			000000f0:  R_MIPS_LO16	.data
			00000110:  R_MIPS_LO16	genphy_c45_driver

  reply	other threads:[~2021-01-12 22:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09 17:11 [BUG mips llvm] MIPS: malformed R_MIPS_{HI16,LO16} with LLVM Alexander Lobakin
2021-01-09 17:50 ` Nick Desaulniers
2021-01-09 19:15   ` Alexander Lobakin
2021-01-09 23:29     ` Alexander Lobakin
2021-01-10  1:08       ` Alexander Lobakin
2021-01-11 20:03     ` Nick Desaulniers
2021-01-11 20:50       ` Alexander Lobakin
2021-01-12 22:14         ` Nick Desaulniers [this message]
2021-01-13 10:16           ` Alexander Lobakin
2021-05-07  7:47 ` Nathan Chancellor
2021-05-08 16:29   ` Alexander Lobakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOdnvd1NaBQEJ0fPsYiGff4=tUdrcuAR0no9FUMqnOZSu6Q@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=alobakin@pm.me \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maskray@google.com \
    --cc=ralf@linux-mips.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).