Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 13:48:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 225890] [mips] GNU 'strip' corrupts static libraries
Message-ID:  <bug-225890-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225890

            Bug ID: 225890
           Summary: [mips] GNU 'strip' corrupts static libraries
           Product: Base System
           Version: 11.1-STABLE
          Hardware: amd64
               URL: http://bpaste.net/show/8y6wgjoHTK5tpa6qOfwN/
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: kpect@protonmail.com
                CC: Jungleboogie0@gmail.com, bapt@FreeBSD.org,
                    daniel.engberg.lists@pyret.net, dim@FreeBSD.org,
                    emaste@freebsd.org, garga@FreeBSD.org,
                    gnn@FreeBSD.org, kpect@protonmail.com,
                    lidl@FreeBSD.org, na@rtfm.net, pi@FreeBSD.org,
                    sbruno@FreeBSD.org, sson@freebsd.org,
                    theraven@FreeBSD.org

+++ This bug was initially created as a clone of Bug #191587 +++

the issue is similar to Bug #191587, 'strip' removes not requested sections

$ echo 'int fun(int x){return x+42;}' > misc.c && cc -c misc.c && ar -rc mi=
sc.a
misc.o && cp misc.a misc2.a
$ strip -R .comment misc.a
$ ranlib misc.a
ranlib: warning: can't find .strtab section
$ readelf -e misc.a

File: misc.a(misc.o)
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            FreeBSD
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           Advanced Micro Devices x86-64
  Version:                           0x1
  Entry point address:               0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          192 (bytes into file)
  Flags:                             0
  Size of this header:               64 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           64 (bytes)
  Number of section headers:         6
  Section header string table index: 5

There are no program headers in this file.
There are 6 section headers, starting at offset 0xc0:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .text             PROGBITS         0000000000000000  00000040
       0000000000000011  0000000000000000  AX       0     0     16
  [ 2] .note.GNU-stack   PROGBITS         0000000000000000  00000051
       0000000000000000  0000000000000000           0     0     1
  [ 3] .eh_frame         X86_64_UNWIND    0000000000000000  00000058
       0000000000000038  0000000000000000   A       0     0     8
  [ 4] .rela.eh_frame    RELA             0000000000000000  00000090
       0000000000000000  0000000000000018   I       0     3     8
  [ 5] .shstrtab         STRTAB           0000000000000000  00000090
       0000000000000030  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
$ readelf --string-dump .strtab misc.a

File: misc.a(misc.o)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225890-8>