Date: Friday, February 3, 2023 @ 12:44:00
  Author: freswa
Revision: 468145

fix detection of linker scripts by ldconfig

ldconfig checks files for either `GROUP` or `GNU ld script` in its header. If
both are not present and the file isn't an ELF file either, it bails out with
"... is not an ELF file - it has the wrong magic bytes at the start".
This commit adds the missing headers.

fixes FS#77365

Modified:
  binutils/trunk/PKGBUILD

----------+
 PKGBUILD |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-03 09:15:50 UTC (rev 468144)
+++ PKGBUILD    2023-02-03 12:44:00 UTC (rev 468145)
@@ -110,9 +110,18 @@
 
   # No shared linking to these files outside binutils
   rm -f "$pkgdir"/usr/lib/lib{bfd,opcodes}.so
-  echo 'INPUT( /usr/lib/libbfd.a -lsframe -liberty -lz -lzstd -ldl )' > 
"$pkgdir/usr/lib/libbfd.so"
-  echo 'INPUT( /usr/lib/libopcodes.a -lbfd )' > "$pkgdir/usr/lib/libopcodes.so"
+  tee "$pkgdir/usr/lib/libbfd.so" << EOS
+/* GNU ld script */
 
+INPUT( /usr/lib/libbfd.a -lsframe -liberty -lz -lzstd -ldl )
+EOS
+
+  tee "$pkgdir/usr/lib/libopcodes.so" << EOS
+/* GNU ld script */
+
+INPUT( /usr/lib/libopcodes.a -lbfd )
+EOS
+
   # install FSF All Permissive License
   install -Dm644 -t "${pkgdir}"/usr/share/licenses/${pkgname}/ FSFAP
 }

Reply via email to