bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/19827] New: Wrong relocation with linker-defined symbol in PIE


From: hjl.tools at gmail dot com
Subject: [Bug ld/19827] New: Wrong relocation with linker-defined symbol in PIE
Date: Tue, 15 Mar 2016 15:19:22 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19827

            Bug ID: 19827
           Summary: Wrong relocation with linker-defined symbol in PIE
           Product: binutils
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

address@hidden pr19807b]$ cat x.s
        .text
        .global _start
_start:
        .dc.a _bss
address@hidden pr19807b]$ cat x.t
_bss = .;
address@hidden pr19807b]$ make
as --32  -o x.o x.s
./ld.2.26 -pie -m elf_i386 -T x.t x.o -o x
./ld.2.26 -shared -Bsymbolic -m elf_i386 -T x.t x.o -o y
readelf -r --dyn-syms --wide x

Relocation section '.rel.dyn' at offset 0x1054 contains 1 entries:
 Offset     Info    Type                Sym. Value  Symbol's Name
00000000  00000101 R_386_32               00000000   _bss
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should be R_386_RELATIVE, the same as -shared -Bsymbolic.

Symbol table '.dynsym' contains 2 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 NOTYPE  GLOBAL DEFAULT    1 _bss
readelf -r --dyn-syms --wide y

Relocation section '.rel.dyn' at offset 0x105c contains 1 entries:
 Offset     Info    Type                Sym. Value  Symbol's Name
00000000  00000008 R_386_RELATIVE        

Symbol table '.dynsym' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 NOTYPE  GLOBAL DEFAULT    1 _bss
     2: 00000000     0 NOTYPE  GLOBAL DEFAULT    1 _start
address@hidden pr19807b]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]