Bug 1849335 - nm and related utilities look for i686 library rather than x86_64
Summary: nm and related utilities look for i686 library rather than x86_64
Keywords:
Status: CLOSED DUPLICATE of bug 1836618
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-20 19:43 UTC by Valdis Kletnieks
Modified: 2020-06-22 21:24 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-06-22 21:24:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
strace of 'nm ./latent_entropy.o' (41.84 KB, text/plain)
2020-06-20 19:43 UTC, Valdis Kletnieks
no flags Details
A .o file that demonstrates the problem. (861.49 KB, application/x-object)
2020-06-20 19:44 UTC, Valdis Kletnieks
no flags Details

Description Valdis Kletnieks 2020-06-20 19:43:08 UTC
Created attachment 1698206 [details]
strace of  'nm ./latent_entropy.o'

Description of problem:
I have llvm-libs.i686 and llvm-libs.x86_84 installed. On some binaries, nm and ar will throw an error message:

% file latent_entropy_plugin.o
latent_entropy_plugin.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
% nm latent_entropy_plugin.o | grep bfd
nm: Failed to load plugin '/usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so', reason: /usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so: wrong ELF class: ELFCLASS32

The weird thing is that strace shows it looks in lib64 and finds the correct .so, and then turns around and searches for it *again* in the wrong lib.
From the strace:
     97 access("/usr/bin/nm", X_OK)             = 0
     98 stat("/usr/bin/nm", {st_mode=S_IFREG|0755, st_size=55816, ...}) = 0
     99 lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    100 lstat("/usr/bin", {st_mode=S_IFDIR|0555, st_size=69632, ...}) = 0
    101 lstat("/usr/bin/nm", {st_mode=S_IFREG|0755, st_size=55816, ...}) = 0
    102 stat("/usr/bin/../lib64/bfd-plugins", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    103 openat(AT_FDCWD, "/usr/bin/../lib64/bfd-plugins", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
    104 fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    105 getdents64(4, 0x56511166c740 /* 3 entries */, 32768) = 80
    106 stat("/usr/bin/../lib64/bfd-plugins/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    107 stat("/usr/bin/../lib64/bfd-plugins/LLVMgold.so", {st_mode=S_IFREG|0755, st_size=193888, ...}) = 0
    108 openat(AT_FDCWD, "/usr/bin/../lib64/bfd-plugins/LLVMgold.so", O_RDONLY|O_CLOEXEC) = 5
(...)

    247 access("/usr/bin/nm", X_OK)             = 0
    248 stat("/usr/bin/nm", {st_mode=S_IFREG|0755, st_size=55816, ...}) = 0
    249 lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    250 lstat("/usr/bin", {st_mode=S_IFDIR|0555, st_size=69632, ...}) = 0
    251 lstat("/usr/bin/nm", {st_mode=S_IFREG|0755, st_size=55816, ...}) = 0
    252 stat("/usr/bin/../bin/../lib/bfd-plugins", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    253 openat(AT_FDCWD, "/usr/bin/../bin/../lib/bfd-plugins", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
    254 fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    255 getdents64(4, 0x5651116b0f80 /* 3 entries */, 32768) = 80
    256 stat("/usr/bin/../bin/../lib/bfd-plugins/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    257 stat("/usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so", {st_mode=S_IFREG|0755, st_size=197740, ...}) = 0
    258 openat(AT_FDCWD, "/usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so", O_RDONLY|O_CLOEXEC) = 5

Version-Release number of selected component (if applicable):
llvm-libs-10.0.0-3.fc33.x86_64
llvm-libs-10.0.0-3.fc33.i686


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Valdis Kletnieks 2020-06-20 19:44:45 UTC
Created attachment 1698207 [details]
A .o file that demonstrates the problem.

Comment 2 Josh Stone 2020-06-22 20:21:04 UTC
This is probably a duplicate of bug 1836618.

Comment 3 Valdis Kletnieks 2020-06-22 21:24:52 UTC
Yep. Pilot error on my part thinking it was llvm issue rather than binutils, otherwise I'd have found that bug report.

*** This bug has been marked as a duplicate of bug 1836618 ***


Note You need to log in before you can comment on or make changes to this bug.