[Bug 195653] New: elftoolchain strip(1) corrupts PT_TLS segment

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Dec 3 20:21:28 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195653

            Bug ID: 195653
           Summary: elftoolchain strip(1) corrupts PT_TLS segment
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: emaste at freebsd.org

See PR195661 for an exp-run with WITH_ELFTOOLCHAIN_TOOLS=yes
Antoine found that make and csh segfaultPR195561)

Make, before running elftoolchain strip:

% feynman% readelf -l make.orig                                            
% 
% Elf file type is EXEC (Executable file)
% Entry point 0x4001a0
% There are 5 program headers, starting at offset 64
% 
% Program Headers:
%   Type           Offset             VirtAddr           PhysAddr
%                  FileSiz            MemSiz              Flags  Align
%   LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
%                  0x000000000009185c 0x000000000009185c  R E    200000
%   LOAD           0x0000000000091860 0x0000000000691860 0x0000000000691860
%                  0x0000000000003680 0x0000000000013118  RW     200000
%   NOTE           0x0000000000000158 0x0000000000400158 0x0000000000400158
%                  0x0000000000000030 0x0000000000000030  R      4
%   TLS            0x0000000000091860 0x0000000000691860 0x0000000000691860
%                  0x0000000000000004 0x0000000000000088  R      10
%   GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
%                  0x0000000000000000 0x0000000000000000  RW     8
% 
%  Section to Segment mapping:
%   Segment Sections...
%    00     .note.tag .init .text .fini .rodata .eh_frame 
%    01     .tdata .ctors .dtors .jcr .got.plt .data .bss 
%    02     .note.tag 
%    03     .tdata .tbss 
%    04     

After strip(1):

% feynman% readelf -l make                                                 
% 
% Elf file type is EXEC (Executable file)
% Entry point 0x4001a0
% There are 5 program headers, starting at offset 64
% 
% Program Headers:
%   Type           Offset             VirtAddr           PhysAddr
%                  FileSiz            MemSiz              Flags  Align
%   LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
%                  0x000000000009185c 0x000000000009185c  R E    200000
%   LOAD           0x0000000000091860 0x0000000000691860 0x0000000000691860
%                  0x0000000000003680 0x0000000000013118  RW     200000
%   NOTE           0x0000000000000158 0x0000000000400158 0x0000000000400158
%                  0x0000000000000030 0x0000000000000030  R      4
%   TLS            0x0000000000091860 0x0000000000691860 0x0000000000691860
%                  0x0000000000000004 0x000000000000007c  R      10
%   GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
%                  0x0000000000000000 0x0000000000000000  RW     8
% 
%  Section to Segment mapping:
%   Segment Sections...
%    00     .note.tag .init .text .fini .rodata .eh_frame 
%    01     .tdata .ctors .dtors .jcr .got.plt .data .bss 
%    02     .note.tag 
%    03     .tdata 
%    04     

Note TLS MemSiz 0x88 -> 0x7c and segment 03 dropped .tbss

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


More information about the freebsd-bugs mailing list