[Bug binutils/10337] New: strip breaks statically linked binaries with .rela.plt section

View: New views
4 Messages — Rating Filter:   Alert me  

[Bug binutils/10337] New: strip breaks statically linked binaries with .rela.plt section

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On --enable-multiarch configured glibc if I do:

elf/ldconfig --version; \
/usr/src/binutils/obj/binutils/strip-new elf/ldconfig; \
elf/ldconfig --version

I get:
ldconfig (GNU libc) 2.10.90
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
unexpected reloc type in static binaryAborted

Before stripping we have:
...
  [ 2] .note.gnu.build-id NOTE            0000000000400178 000178 000024 00   A
0   0  4
  [ 3] .rela.plt         RELA            00000000004001a0 0001a0 000030 18   A
0   5  8
  [ 4] .init             PROGBITS        00000000004001d0 0001d0 000018 00  AX
0   0  4
  [ 5] .plt              PROGBITS        00000000004001e8 0001e8 000020 00  AX
0   0  4
...
  1373: 00000000004001d0     0 NOTYPE  LOCAL  HIDDEN    3 __rela_iplt_end
  1374: 00000000006b1030     0 NOTYPE  LOCAL  HIDDEN   17 __fini_array_end
  1375: 00000000004001a0     0 NOTYPE  LOCAL  HIDDEN    3 __rela_iplt_start
after stripping:
  [ 2] .note.gnu.build-id NOTE            0000000000400178 000178 000024 00   A
0   0  4
  [ 3] .plt              PROGBITS        00000000004001e8 0001e8 000020 00  AX
0   0  4
  [ 4] .rela.plt         RELA            0000000000000000 0b6588 000000 18    
0   3  8
  [ 5] .init             PROGBITS        00000000004001d0 0001d0 000018 00  AX
0   0  4
(note non-allocated RELA section) and all 48 bytes between 0x1a0 and 0x1d0 in
the file are cleared.

--
           Summary: strip breaks statically linked binaries with .rela.plt
                    section
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: jakub at redhat dot com
                CC: bug-binutils at gnu dot org
GCC target triplet: x86_64-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=10337

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug binutils/10337] strip breaks statically linked binaries with .rela.plt section

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com


http://sourceware.org/bugzilla/show_bug.cgi?id=10337

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug binutils/10337] strip breaks statically linked binaries with .rela.plt section

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-06-27 16:07 -------
Subject: Bug 10337

CVSROOT: /cvs/src
Module name: src
Changes by: hjl@... 2009-06-27 16:07:10

Modified files:
        bfd            : ChangeLog elf.c
        ld/testsuite   : ChangeLog
Added files:
        ld/testsuite/ld-ifunc: binutils.exp

Log message:
        bfd/
       
        2009-06-27  H.J. Lu  <hongjiu.lu@...>
       
        PR ld/10337
        * elf.c (bfd_section_from_shdr): Don't change sh_link for
        SHT_REL/SHT_RELA sections on executable nor shared library.
        Treat SHT_REL/SHT_RELA sections with sh_link set to SHN_UNDEF
        as a normal section.
       
        ld/testsuite/
       
        2009-06-27  H.J. Lu  <hongjiu.lu@...>
       
        PR ld/10337
        * ld-ifunc/binutils.exp: New.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4673&r2=1.4674
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.482&r2=1.483
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1117&r2=1.1118
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/binutils.exp.diff?cvsroot=src&r1=NONE&r2=1.1



--


http://sourceware.org/bugzilla/show_bug.cgi?id=10337

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug binutils/10337] strip breaks statically linked binaries with .rela.plt section

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From hjl dot tools at gmail dot com  2009-06-27 16:08 -------
Fixed.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10337

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils