From owner-freebsd-bugs@freebsd.org Fri Aug 7 13:01:18 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A8493BA0D1 for ; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4BNQTp3KvRz4P79 for ; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 7258A3B9E66; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 722043BA308 for ; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNQTp2mYFz4PFZ for ; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4384618231 for ; Fri, 7 Aug 2020 13:01:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 077D1ISB019949 for ; Fri, 7 Aug 2020 13:01:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 077D1IqG019948 for bugs@FreeBSD.org; Fri, 7 Aug 2020 13:01:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 248516] elftoolchain error when building linux_vdso.so with llvm objcopy Date: Fri, 07 Aug 2020 13:01:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: arichardson@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 13:01:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248516 Bug ID: 248516 Summary: elftoolchain error when building linux_vdso.so with llvm objcopy Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: arichardson@FreeBSD.org I am seeing "strip: gelf_getshdr failed: Invalid argument" when building linux_vdso.so (compiled with upstream clang 10 and using llvm-objcopy). I am not sure if this is a problem with llvm-objcopy 10 or whether we shoul= d be passing different flags (llvm-objcopy has a --strip-all-gnu flag that produ= ces compatible output). Since we invoke strip afterwards so I'm not sure if the -S flag is needed at all. Whatever we choose to do, I don't think elftoolchain strip should be reject= ing the file produced by llvm-objcopy? It works just fine if I use `/usr/local/opt/llvm/bin/llvm-strip -N _binary_linux_locore_o_size vdso.llvm-objcopy.so`, but using elftoolchain s= trip gives me the error --- vdso.elftoolchain-objcopy.so +++ vdso.llvm-objcopy.so =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --file-header {} =E2=94=82 @@ -6,15 +6,15 @@ =E2=94=82 OS/ABI: UNIX - System V =E2=94=82 ABI Version: 0 =E2=94=82 Type: REL (Relocatable file) =E2=94=82 Machine: Advanced Micro Devices X86-= 64 =E2=94=82 Version: 0x1 =E2=94=82 Entry point address: 0x0 =E2=94=82 Start of program headers: 0 (bytes into file) =E2=94=82 - Start of section headers: 3352 (bytes into file) =E2=94=82 + Start of section headers: 3328 (bytes into file) =E2=94=82 Flags: 0x0 =E2=94=82 Size of this header: 64 (bytes) =E2=94=82 Size of program headers: 0 (bytes) =E2=94=82 Number of program headers: 0 =E2=94=82 Size of section headers: 64 (bytes) =E2=94=82 - Number of section headers: 5 =E2=94=82 - Section header string table index: 2 =E2=94=82 + Number of section headers: 3 =E2=94=82 + Section header string table index: 1 =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --sections {} =E2=94=82 @@ -1,14 +1,12 @@ =E2=94=82 -There are 5 section headers, starting at offset 0xd18: =E2=94=82 +There are 3 section headers, starting at offset 0xd00: =E2=94=82=20=20 =E2=94=82 Section Headers: =E2=94=82 [Nr] Name Type Address Off = Size ES Flg Lk Inf Al =E2=94=82 [ 0] NULL 0000000000000000 000000= 000000 00=20=20 0 0 0 =E2=94=82 - [ 1] .data PROGBITS 0000000000000000 000040= 000cb0 00=20 WA 0 0 1 =E2=94=82 - [ 2] .shstrtab STRTAB 0000000000000000 000cf0= 000022 00=20=20 0 0 1 =E2=94=82 - [ 3] .symtab SYMTAB 0000000000000000 000e58= 000078 18=20=20 4 2 8 =E2=94=82 - [ 4] .strtab STRTAB 0000000000000000 000ed0= 000055 00=20=20 0 0 1 =E2=94=82 + [ 1] .strtab STRTAB 0000000000000000 000040= 00000f 00=20=20 0 0 1 =E2=94=82 + [ 2] .data PROGBITS 0000000000000000 00004f= 000cb0 00=20 WA 0 0 1 =E2=94=82 Key to Flags: =E2=94=82 W (write), A (alloc), X (execute), M (merge), S (strings), I (= info), =E2=94=82 L (link order), O (extra OS processing required), G (group), T= (TLS), =E2=94=82 C (compressed), x (unknown), o (OS specific), E (exclude), =E2=94=82 l (large), p (processor specific) =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --symbols {} =E2=94=82 @@ -1,8 +0,0 @@ =E2=94=82 - =E2=94=82 -Symbol table '.symtab' contains 5 entries: =E2=94=82 - Num: Value Size Type Bind Vis Ndx Name =E2=94=82 - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND=20 =E2=94=82 - 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1=20 =E2=94=82 - 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _binary_linux_locore_o_start =E2=94=82 - 3: 0000000000000cb0 0 NOTYPE GLOBAL DEFAULT 1 _binary_linux_locore_o_end =E2=94=82 - 4: 0000000000000cb0 0 NOTYPE GLOBAL DEFAULT ABS _binary_linux_locore_o_size =E2=94=9C=E2=94=80=E2=94=80 strings --all --bytes=3D8 {} =E2=94=82 @@ -24,11 +24,7 @@ =E2=94=82 __vdso_gettimeofday =E2=94=82 __vdso_time =E2=94=82 clock_gettime =E2=94=82 gettimeofday =E2=94=82 linux_platform =E2=94=82 linux_rt_sigcode =E2=94=82 _DYNAMIC =E2=94=82 -.shstrtab =E2=94=82 -_binary_linux_locore_o_start =E2=94=82 -_binary_linux_locore_o_end =E2=94=82 -_binary_linux_locore_o_size =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --decompress --hex-dump=3D.strt= ab {} =E2=94=82 @@ -1,9 +1,4 @@ =E2=94=82=20=20 =E2=94=82 Hex dump of section '.strtab': =E2=94=82 - 0x00000000 005f6269 6e617279 5f6c696e 75785f6c ._binary_linux_l =E2=94=82 - 0x00000010 6f636f72 655f6f5f 73746172 74005f62 ocore_o_start._b =E2=94=82 - 0x00000020 696e6172 795f6c69 6e75785f 6c6f636f inary_linux_loco =E2=94=82 - 0x00000030 72655f6f 5f656e64 005f6269 6e617279 re_o_end._binary =E2=94=82 - 0x00000040 5f6c696e 75785f6c 6f636f72 655f6f5f _linux_locore_o_ =E2=94=82 - 0x00000050 73697a65 00 size. =E2=94=82 + 0x00000000 002e7374 72746162 002e6461 746100 ..strtab..data. LLVM objcopy with --strip-all-gnu --- vdso.elftoolchain-objcopy.so +++ vdso.llvm-objcopy-strip-all-gnu.so =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --file-header {} =E2=94=82 @@ -6,15 +6,15 @@ =E2=94=82 OS/ABI: UNIX - System V =E2=94=82 ABI Version: 0 =E2=94=82 Type: REL (Relocatable file) =E2=94=82 Machine: Advanced Micro Devices X86-= 64 =E2=94=82 Version: 0x1 =E2=94=82 Entry point address: 0x0 =E2=94=82 Start of program headers: 0 (bytes into file) =E2=94=82 - Start of section headers: 3352 (bytes into file) =E2=94=82 + Start of section headers: 3328 (bytes into file) =E2=94=82 Flags: 0x0 =E2=94=82 Size of this header: 64 (bytes) =E2=94=82 Size of program headers: 0 (bytes) =E2=94=82 Number of program headers: 0 =E2=94=82 Size of section headers: 64 (bytes) =E2=94=82 - Number of section headers: 5 =E2=94=82 - Section header string table index: 2 =E2=94=82 + Number of section headers: 3 =E2=94=82 + Section header string table index: 1 =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --sections {} =E2=94=82 @@ -1,14 +1,12 @@ =E2=94=82 -There are 5 section headers, starting at offset 0xd18: =E2=94=82 +There are 3 section headers, starting at offset 0xd00: =E2=94=82=20=20 =E2=94=82 Section Headers: =E2=94=82 [Nr] Name Type Address Off = Size ES Flg Lk Inf Al =E2=94=82 [ 0] NULL 0000000000000000 000000= 000000 00=20=20 0 0 0 =E2=94=82 - [ 1] .data PROGBITS 0000000000000000 000040= 000cb0 00=20 WA 0 0 1 =E2=94=82 - [ 2] .shstrtab STRTAB 0000000000000000 000cf0= 000022 00=20=20 0 0 1 =E2=94=82 - [ 3] .symtab SYMTAB 0000000000000000 000e58= 000078 18=20=20 4 2 8 =E2=94=82 - [ 4] .strtab STRTAB 0000000000000000 000ed0= 000055 00=20=20 0 0 1 =E2=94=82 + [ 1] .strtab STRTAB 0000000000000000 000040= 00000f 00=20=20 0 0 1 =E2=94=82 + [ 2] .data PROGBITS 0000000000000000 00004f= 000cb0 00=20 WA 0 0 1 =E2=94=82 Key to Flags: =E2=94=82 W (write), A (alloc), X (execute), M (merge), S (strings), I (= info), =E2=94=82 L (link order), O (extra OS processing required), G (group), T= (TLS), =E2=94=82 C (compressed), x (unknown), o (OS specific), E (exclude), =E2=94=82 l (large), p (processor specific) =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --symbols {} =E2=94=82 @@ -1,8 +0,0 @@ =E2=94=82 - =E2=94=82 -Symbol table '.symtab' contains 5 entries: =E2=94=82 - Num: Value Size Type Bind Vis Ndx Name =E2=94=82 - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND=20 =E2=94=82 - 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1=20 =E2=94=82 - 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _binary_linux_locore_o_start =E2=94=82 - 3: 0000000000000cb0 0 NOTYPE GLOBAL DEFAULT 1 _binary_linux_locore_o_end =E2=94=82 - 4: 0000000000000cb0 0 NOTYPE GLOBAL DEFAULT ABS _binary_linux_locore_o_size =E2=94=9C=E2=94=80=E2=94=80 strings --all --bytes=3D8 {} =E2=94=82 @@ -24,11 +24,7 @@ =E2=94=82 __vdso_gettimeofday =E2=94=82 __vdso_time =E2=94=82 clock_gettime =E2=94=82 gettimeofday =E2=94=82 linux_platform =E2=94=82 linux_rt_sigcode =E2=94=82 _DYNAMIC =E2=94=82 -.shstrtab =E2=94=82 -_binary_linux_locore_o_start =E2=94=82 -_binary_linux_locore_o_end =E2=94=82 -_binary_linux_locore_o_size =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --decompress --hex-dump=3D.strt= ab {} =E2=94=82 @@ -1,9 +1,4 @@ =E2=94=82=20=20 =E2=94=82 Hex dump of section '.strtab': =E2=94=82 - 0x00000000 005f6269 6e617279 5f6c696e 75785f6c ._binary_linux_l =E2=94=82 - 0x00000010 6f636f72 655f6f5f 73746172 74005f62 ocore_o_start._b =E2=94=82 - 0x00000020 696e6172 795f6c69 6e75785f 6c6f636f inary_linux_loco =E2=94=82 - 0x00000030 72655f6f 5f656e64 005f6269 6e617279 re_o_end._binary =E2=94=82 - 0x00000040 5f6c696e 75785f6c 6f636f72 655f6f5f _linux_locore_o_ =E2=94=82 - 0x00000050 73697a65 00 size. =E2=94=82 + 0x00000000 002e7374 72746162 002e6461 746100 ..strtab..data. GNU objcopy output: --- vdso.elftoolchain-objcopy.so +++ vdso.gnu-objcopy.so =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --file-header {} =E2=94=82 @@ -6,15 +6,15 @@ =E2=94=82 OS/ABI: UNIX - System V =E2=94=82 ABI Version: 0 =E2=94=82 Type: REL (Relocatable file) =E2=94=82 Machine: Advanced Micro Devices X86-= 64 =E2=94=82 Version: 0x1 =E2=94=82 Entry point address: 0x0 =E2=94=82 Start of program headers: 0 (bytes into file) =E2=94=82 - Start of section headers: 3352 (bytes into file) =E2=94=82 + Start of section headers: 3552 (bytes into file) =E2=94=82 Flags: 0x0 =E2=94=82 Size of this header: 64 (bytes) =E2=94=82 Size of program headers: 0 (bytes) =E2=94=82 Number of program headers: 0 =E2=94=82 Size of section headers: 64 (bytes) =E2=94=82 Number of section headers: 5 =E2=94=82 - Section header string table index: 2 =E2=94=82 + Section header string table index: 4 =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --sections {} =E2=94=82 @@ -1,14 +1,14 @@ =E2=94=82 -There are 5 section headers, starting at offset 0xd18: =E2=94=82 +There are 5 section headers, starting at offset 0xde0: =E2=94=82=20=20 =E2=94=82 Section Headers: =E2=94=82 [Nr] Name Type Address Off = Size ES Flg Lk Inf Al =E2=94=82 [ 0] NULL 0000000000000000 000000= 000000 00=20=20 0 0 0 =E2=94=82 [ 1] .data PROGBITS 0000000000000000 000040= 000cb0 00=20 WA 0 0 1 =E2=94=82 - [ 2] .shstrtab STRTAB 0000000000000000 000cf0= 000022 00=20=20 0 0 1 =E2=94=82 - [ 3] .symtab SYMTAB 0000000000000000 000e58= 000078 18=20=20 4 2 8 =E2=94=82 - [ 4] .strtab STRTAB 0000000000000000 000ed0= 000055 00=20=20 0 0 1 =E2=94=82 + [ 2] .symtab SYMTAB 0000000000000000 000cf0= 000078 18=20=20 3 2 8 =E2=94=82 + [ 3] .strtab STRTAB 0000000000000000 000d68= 000055 00=20=20 0 0 1 =E2=94=82 + [ 4] .shstrtab STRTAB 0000000000000000 000dbd= 000021 00=20=20 0 0 1 =E2=94=82 Key to Flags: =E2=94=82 W (write), A (alloc), X (execute), M (merge), S (strings), I (= info), =E2=94=82 L (link order), O (extra OS processing required), G (group), T= (TLS), =E2=94=82 C (compressed), x (unknown), o (OS specific), E (exclude), =E2=94=82 l (large), p (processor specific) =E2=94=9C=E2=94=80=E2=94=80 strings --all --bytes=3D8 {} =E2=94=82 @@ -24,11 +24,11 @@ =E2=94=82 __vdso_gettimeofday =E2=94=82 __vdso_time =E2=94=82 clock_gettime =E2=94=82 gettimeofday =E2=94=82 linux_platform =E2=94=82 linux_rt_sigcode =E2=94=82 _DYNAMIC =E2=94=82 -.shstrtab =E2=94=82 _binary_linux_locore_o_start =E2=94=82 _binary_linux_locore_o_end =E2=94=82 _binary_linux_locore_o_size =E2=94=82 +.shstrtab =E2=94=9C=E2=94=80=E2=94=80 greadelf --wide --decompress --hex-dump=3D.shst= rtab {} =E2=94=82 @@ -1,6 +1,6 @@ =E2=94=82=20=20 =E2=94=82 Hex dump of section '.shstrtab': =E2=94=82 - 0x00000000 00002e73 796d7461 62002e73 74727461 ...symtab..strta =E2=94=82 - 0x00000010 62002e73 68737472 74616200 2e646174 b..shstrtab..dat =E2=94=82 - 0x00000020 6100 a. =E2=94=82 + 0x00000000 002e7379 6d746162 002e7374 72746162 ..symtab..strtab =E2=94=82 + 0x00000010 002e7368 73747274 6162002e 64617461 ..shstrtab..data =E2=94=82 + 0x00000020 00 . --=20 You are receiving this mail because: You are the assignee for the bug.=