Bug 1169192

Summary: file shows file as 'statically linked', but readelf listed all NEEDED require
Product: [openSUSE] openSUSE Tumbleweed Reporter: Holger Bruenjes <holgerbruenjes>
Component: BasesystemAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: alynx.zhou, dimstar, fvogt, holgerbruenjes
Version: CurrentFlags: werner: needinfo? (holgerbruenjes)
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Holger Bruenjes 2020-04-10 13:51:53 UTC
file --version
file-5.38

shows 'statically linked'

 file /usr/lib64/libmagic.so.1.0.0 
/usr/lib64/libmagic.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=f5c22cef0ef8447fe35a2b3b7d4a54fe59efd1bd, stripped


but with readelf -d 

readelf -d /usr/lib64/libmagic.so.1.0.0 

Dynamic section at offset 0x26d98 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [liblzma.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libbz2.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libmagic.so.1]


all NEEDED require where listed, so is libmagic 'not' statically linked



now the old version 5.37 shows 'dynamically linked'

file --version
file-5.37

file /usr/lib/libmagic.so.1.0.0 
/usr/lib/libmagic.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=fe072c8ca1a6192ac4ecf6ae4c57353fb3c04869, stripped
Comment 1 Dr. Werner Fink 2020-04-27 06:31:35 UTC
I do not see this:

```
file --version
file-5.38
magic file from /etc/magic:/usr/share/misc/magic
```

```
file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bf381b6f018c1550e2ef9bf2201fd7ebb03b2609, for GNU/Linux 3.2.0, stripped
```

```
readelf -d /usr/bin/file

Dynamic section at offset 0x5dc0 contains 28 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libmagic.so.1]
 0x000000000000000c (INIT)               0x2000
 [...]
```

```
readelf -d /usr/lib64/libmagic.so.1.0.0 

Dynamic section at offset 0x26d98 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [liblzma.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libbz2.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libmagic.so.1]
 0x000000000000000c (INIT)               0x6000
 [...]
```
Comment 2 Dr. Werner Fink 2020-04-27 06:32:09 UTC
Btw: Which architecture do you use?
Comment 3 Dr. Werner Fink 2020-04-27 06:33:37 UTC
... and which Tumbleweed serial number is installed ... maybe we face a bug in the build system
Comment 4 Holger Bruenjes 2020-04-27 06:51:31 UTC
Distributor ID: openSUSE
Description:    openSUSE Tumbleweed
Release:        20200422


please have a look to libmagic, this effected all librarys, not binarys


file /usr/lib64/libmagic.so.1.0.0 
/usr/lib64/libmagic.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=f5c22cef0ef8447fe35a2b3b7d4a54fe59efd1bd, stripped

 readelf -d /usr/lib64/libmagic.so.1.0.0 

Dynamic section at offset 0x26d98 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [liblzma.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libbz2.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libmagic.so.1]


file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bf381b6f018c1550e2ef9bf2201fd7ebb03b2609, for GNU/Linux 3.2.0, stripped

when I revert this commit, also for libmagic show dynamically linked, but I can not say, it this the correct way

https://github.com/file/file/commit/24c9c086cd7c55b7b0a003a145b32466468e2608#diff-bc5c24ef9f39a5f4963ca28ecbc645b3
Comment 5 Dr. Werner Fink 2020-04-27 07:18:09 UTC
Yep, seems to be known at upstream https://mailman.astron.com/pipermail/file/2020-April/000325.html
Comment 6 Swamp Workflow Management 2020-05-04 14:30:19 UTC
This is an autogenerated message for OBS integration:
This bug (1169192) was mentioned in
https://build.opensuse.org/request/show/800076 Factory / file
Comment 7 Dr. Werner Fink 2020-05-06 07:50:43 UTC
Fixed with SR#800076
Comment 8 Dr. Werner Fink 2020-05-06 07:56:45 UTC
Fixed with SR#800076
Comment 9 Dr. Werner Fink 2020-09-18 07:09:36 UTC
*** Bug 1176123 has been marked as a duplicate of this bug. ***