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

            Bug ID: 33504
           Summary: FAIL: Discarded dynamic relocation section
           Product: binutils
           Version: 2.46 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa*-*-linux*
            Target: hppa64-*-linux*
             Build: hppa*-*-linux*

/home/dave/gnu/binutils/objdir64/ld/../gas/as-new  --defsym ALIGN=3    -o
tmpdir
/reloc-discard.o
/home/dave/gnu/binutils/src/ld/testsuite/ld-elf/reloc-discard.s
Executing on host: sh -c {/home/dave/gnu/binutils/objdir64/ld/../gas/as-new 
--defsym ALIGN=3    -o tmpdir/reloc-discard.o
/home/dave/gnu/binutils/src/ld/testsuite/ld-elf/reloc-discard.s 2>&1} 
/dev/null dump.tmp (timeout = 300)
spawn [open ...]
./ld-new  -z nomemory-seal  -L/home/dave/gnu/binutils/src/ld/testsuite/ld-elf 
-shared -T reloc-discard.ld -o tmpdir/dump tmpdir/reloc-discard.o
Executing on host: sh -c {./ld-new  -z nomemory-seal 
-L/home/dave/gnu/binutils/src/ld/testsuite/ld-elf  -shared -T reloc-discard.ld
-o tmpdir/dump tmpdir/reloc-discard.o  2>&1}  /dev/null dump.tmp (timeout =
300)
spawn [open ...]
/home/dave/gnu/binutils/objdir64/ld/../binutils/readelf  -r --use-dynamic
tmpdir/dump > tmpdir/dump.out
Executing on host: sh -c
{/home/dave/gnu/binutils/objdir64/ld/../binutils/readelf  -r --use-dynamic
tmpdir/dump > tmpdir/dump.out 2>dump.tmp}  /dev/null  (timeout = 300)
spawn [open ...]
regexp_diff match failure
regexp "^There are no dynamic relocations in this file\.$"
line   "'RELA' relocation section at offset 0 contains 24 bytes:"
extra lines in tmpdir/dump.out starting with "^  Offset          Info          
Type           Sym. Value    Sym. Name + Addend$"
EOF from /home/dave/gnu/binutils/src/ld/testsuite/ld-elf/reloc-discard.d
FAIL: Discarded dynamic relocation section

dave@mx3210:~/gnu/binutils/objdir64/ld/tmpdir$ readelf  -r --use-dynamic dump   
'RELA' relocation section at offset 0 contains 24 bytes:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
000000000000  000000000000 R_PARISC_NONE                        0

Not sure where the above symbol comes from but it causes the test to fail.

dave@mx3210:~/gnu/binutils/objdir64/ld/tmpdir$ readelf  -a  dump
ELF Header:
  Magic:   7f 45 4c 46 02 02 01 03 01 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - GNU
  ABI Version:                       1
  Type:                              DYN (Shared object file)
  Machine:                           HPPA
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          4880 (bytes into file)
  Flags:                             0x90214, PA-RISC 2.0, trapnil, wide
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         3
  Size of section headers:           64 (bytes)
  Number of section headers:         10
  Section header string table index: 9

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .dynsym           DYNSYM           0000000000000000  00001000
       0000000000000030  0000000000000018   A       2     1     8
  [ 2] .dynstr           STRTAB           0000000000000030  00001030
       0000000000000005  0000000000000000   A       0     0     1
  [ 3] .hash             HASH             0000000000000038  00001038
       0000000000000014  0000000000000004   A       1     0     8
  [ 4] .gnu.hash         GNU_HASH         0000000000000050  00001050
       000000000000001c  0000000000000000   A       1     0     8
  [ 5] .data             PROGBITS         000000000000006c  0000106c
       0000000000000008  0000000000000000  WA       0     0     1
  [ 6] .dynamic          DYNAMIC          0000000000000078  00001078
       0000000000000110  0000000000000010  WA       2     0     8
  [ 7] .symtab           SYMTAB           0000000000000000  00001188
       0000000000000120  0000000000000018           8    11     8
  [ 8] .strtab           STRTAB           0000000000000000  000012a8
       0000000000000024  0000000000000000           0     0     1
  [ 9] .shstrtab         STRTAB           0000000000000000  000012cc
       0000000000000044  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  R (retain), D (mbind), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000000000 0x0000000000000000
                 0x00000000000000a8 0x00000000000000a8  R E    0x8
  LOAD           0x0000000000001000 0x0000000000000000 0x0000000000000000
                 0x0000000000000188 0x0000000000000188  RWE    0x1000
  DYNAMIC        0x0000000000001078 0x0000000000000078 0x0000000000000078
                 0x0000000000000110 0x0000000000000110  RW     0x8

 Section to Segment mapping:
  Segment Sections...
   00
   01     .dynsym .dynstr .hash .gnu.hash .data .dynamic
   02     .dynamic

Dynamic section at offset 0x1078 contains 12 entries:
  Tag        Type                         Name/Value
 0x0000000000000004 (HASH)               0x38
 0x000000006ffffef5 (GNU_HASH)           0x50
 0x0000000000000005 (STRTAB)             0x30
 0x0000000000000006 (SYMTAB)             0x0
 0x000000000000000a (STRSZ)              5 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000060000001 (HP_DLD_FLAGS)       0
 0x0000000000000003 (PLTGOT)             0x6c
 0x0000000000000007 (RELA)               0x0
 0x0000000000000008 (RELASZ)             24 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x0000000000000000 (NULL)               0x0

dave@mx3210:~/gnu/binutils/objdir64/ld/tmpdir$ readelf -a reloc-discard.o
ELF Header:
  Magic:   7f 45 4c 46 02 02 01 03 01 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - GNU
  ABI Version:                       1
  Type:                              REL (Relocatable file)
  Machine:                           HPPA
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          312 (bytes into file)
  Flags:                             0x90214, PA-RISC 2.0, trapnil, wide
  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:         8
  Section header string table index: 7

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
       0000000000000000  0000000000000000  AX       0     0     1
  [ 2] .data             PROGBITS         0000000000000000  00000040
       0000000000000008  0000000000000000  WA       0     0     1
  [ 3] .rela.data        RELA             0000000000000000  000000e8
       0000000000000018  0000000000000018   I       5     2     8
  [ 4] .bss              NOBITS           0000000000000000  00000048
       0000000000000000  0000000000000000  WA       0     0     1
  [ 5] .symtab           SYMTAB           0000000000000000  00000048
       0000000000000090  0000000000000018           6     5     8
  [ 6] .strtab           STRTAB           0000000000000000  000000d8
       000000000000000b  0000000000000000           0     0     1
  [ 7] .shstrtab         STRTAB           0000000000000000  00000100
       0000000000000031  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  R (retain), D (mbind), p (processor specific)

There are no section groups in this file.

There are no program headers in this file.

There is no dynamic section in this file.

Relocation section '.rela.data' at offset 0xe8 contains 1 entry:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
000000000000  000500000050 R_PARISC_DIR64    0000000000000000 foo + 0

There are no unwind sections in this file.

Symbol table '.symtab' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000003     0 NOTYPE  LOCAL  DEFAULT  ABS ALIGN
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 .text
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    2 .data
     4: 0000000000000000     0 SECTION LOCAL  DEFAULT    4 .bss
     5: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND foo

No version information found in this file.

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

Reply via email to