ia64-hp-hpux* linker

Denis Scherbakov denis_scherbakov@yahoo.com
Fri Apr 24 14:42:00 GMT 2009


>   It's really odd that this symbol would end up in the abs section.  I don't
> know anything about hpux, but could the hidden visibility somehow mean that in
> file2, shTest is effectively a COMMON symbol (and then, that there's maybe
> some kind of problem with COMMON handling additionally)?  What does "nm
> file1.o" look like when you compile with --save-temps?  Does
> "-fno-zero-initialized-in-bss" help any?

Dave, thanks for asking.

-fno-zero-initialized-in-bss does not help. Here are the outputs:

================================================
$ nm file.o
00000000 T func
         U puts
00000002 A varTest
================================================
$ nm file2.o
00000000 T func2
         U printf
         U varTest
================================================
$ nm main.o
         U func
         U func2
00000000 T main
================================================
$ cat file.s
	.file	"file.c"
	.pred.safe_across_calls p1-p5,p16-p63
	.section	.rodata,	"a",	"progbits"
	.align 8
.LC0:
	stringz	"func test"
	.section	.text,	"ax",	"progbits"
	.align 16
	.global func#
	.type	func#, @function
	.proc func#
func:
	.prologue 14, 32
	.save ar.pfs, r33
	alloc r33 = ar.pfs, 0, 4, 1, 0
	.vframe r34
	mov r34 = r12
	.save rp, r32
	mov r32 = b0
	mov r35 = r1
	.body
	addl r14 = @gprel(varTest#), gp
	;;
	st2 [r14] = r0
	addl r36 = @ltoffx(.LC0), r1
	;;
	ld8.mov r36 = [r36], .LC0
	br.call.sptk.many b0 = puts#
	mov r1 = r35
	;;
	mov ar.pfs = r33
	mov b0 = r32
	.restore sp
	mov r12 = r34
	br.ret.sptk.many b0
	;;
	.endp func#
	.hidden	varTest#
	.common	varTest#,2,2
	.global puts#
	.type	puts#, @function
	.ident	"GCC: (GNU) 4.3.3"
================================================
$ readelf -a file.o
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 01 01 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - HP-UX
  ABI Version:                       1
  Type:                              REL (Relocatable file)
  Machine:                           Intel IA-64
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          344 (bytes into file)
  Flags:                             0x8, 32-bit
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 10

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000040 000070 00  AX  0   0 16
  [ 2] .rela.text        RELA            00000000 000424 000030 0c     11   1  4
  [ 3] .data             PROGBITS        00000000 0000b0 000000 00  WA  0   0  1
  [ 4] .bss              NOBITS          00000000 0000b0 000000 00  WA  0   0  1
  [ 5] .rodata           PROGBITS        00000000 0000b0 00000a 00   A  0   0  8
  [ 6] .IA_64.unwind_inf PROGBITS        00000000 0000bc 000014 00   A  0   0  4
  [ 7] .IA_64.unwind     IA_64_UNWIND    00000000 0000d0 00000c 00  AL  1   1  4
  [ 8] .rela.IA_64.unwin RELA            00000000 000454 000024 0c     11   7  4
  [ 9] .comment          PROGBITS        00000000 0000dc 000012 00      0   0  1
  [10] .shstrtab         STRTAB          00000000 0000ee 000068 00      0   0  1
  [11] .symtab           SYMTAB          00000000 000360 0000b0 10     12   8  4
  [12] .strtab           STRTAB          00000000 000410 000013 00      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)

There are no section groups in this file.

There are no program headers in this file.

Relocation section '.rela.text' at offset 0x424 contains 4 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000011  0000092a R_IA64_GPREL22    00000002   varTest + 0
00000021  00000486 R_IA64_LTOFF22X   00000000   .rodata + 0
00000030  00000487 R_IA64_LDXMOV     00000000   .rodata + 0
00000032  00000a49 R_IA64_PCREL21B   00000000   puts + 0

Relocation section '.rela.IA_64.unwind' at offset 0x454 contains 3 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000000  0000015c R_IA64_SEGREL32MS 00000000   .text + 0
00000004  0000015c R_IA64_SEGREL32MS 00000000   .text + 70
00000008  0000055c R_IA64_SEGREL32MS 00000000   .IA_64.unwind_info + 0

Unwind section '.IA_64.unwind' at offset 0xd0 contains 1 entries:

<func>: [0x0-0x70], info at +0x0
  v1, flags=0x0 (), len=12 bytes
    R2:prologue_gr(mask=[rp,ar.pfs,psp],grsave=r32,rlen=4)
        P7:pfs_when(t=0)
        P7:mem_stack_v(t=1)
        P7:rp_when(t=2)
    R1:body(rlen=17)
        B2:epilogue(t=3,ecount=0)

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 SECTION LOCAL  DEFAULT    1
     2: 00000000     0 SECTION LOCAL  DEFAULT    3
     3: 00000000     0 SECTION LOCAL  DEFAULT    4
     4: 00000000     0 SECTION LOCAL  DEFAULT    5
     5: 00000000     0 SECTION LOCAL  DEFAULT    6
     6: 00000000     0 SECTION LOCAL  DEFAULT    7
     7: 00000000     0 SECTION LOCAL  DEFAULT    9
     8: 00000000   112 FUNC    GLOBAL DEFAULT    1 func
     9: 00000002     2 OBJECT  GLOBAL HIDDEN ANSI_COM varTest
    10: 00000000     0 FUNC    GLOBAL DEFAULT  UND puts

No version information found in this file.
================================================
$ readelf -a file2.o
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 01 01 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - HP-UX
  ABI Version:                       1
  Type:                              REL (Relocatable file)
  Machine:                           Intel IA-64
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          344 (bytes into file)
  Flags:                             0x8, 32-bit
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 10

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000040 000070 00  AX  0   0 16
  [ 2] .rela.text        RELA            00000000 000428 000030 0c     11   1  4
  [ 3] .data             PROGBITS        00000000 0000b0 000000 00  WA  0   0  1
  [ 4] .bss              NOBITS          00000000 0000b0 000000 00  WA  0   0  1
  [ 5] .rodata           PROGBITS        00000000 0000b0 00000a 00   A  0   0  8
  [ 6] .IA_64.unwind_inf PROGBITS        00000000 0000bc 000014 00   A  0   0  4
  [ 7] .IA_64.unwind     IA_64_UNWIND    00000000 0000d0 00000c 00  AL  1   1  4
  [ 8] .rela.IA_64.unwin RELA            00000000 000458 000024 0c     11   7  4
  [ 9] .comment          PROGBITS        00000000 0000dc 000012 00      0   0  1
  [10] .shstrtab         STRTAB          00000000 0000ee 000068 00      0   0  1
  [11] .symtab           SYMTAB          00000000 000360 0000b0 10     12   8  4
  [12] .strtab           STRTAB          00000000 000410 000016 00      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)

There are no section groups in this file.

There are no program headers in this file.

Relocation section '.rela.text' at offset 0x428 contains 4 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000011  0000092a R_IA64_GPREL22    00000000   varTest + 0
00000021  00000486 R_IA64_LTOFF22X   00000000   .rodata + 0
00000030  00000487 R_IA64_LDXMOV     00000000   .rodata + 0
00000032  00000a49 R_IA64_PCREL21B   00000000   printf + 0

Relocation section '.rela.IA_64.unwind' at offset 0x458 contains 3 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000000  0000015c R_IA64_SEGREL32MS 00000000   .text + 0
00000004  0000015c R_IA64_SEGREL32MS 00000000   .text + 70
00000008  0000055c R_IA64_SEGREL32MS 00000000   .IA_64.unwind_info + 0

Unwind section '.IA_64.unwind' at offset 0xd0 contains 1 entries:

<func2>: [0x0-0x70], info at +0x0
  v1, flags=0x0 (), len=12 bytes
    R2:prologue_gr(mask=[rp,ar.pfs,psp],grsave=r32,rlen=4)
        P7:pfs_when(t=0)
        P7:mem_stack_v(t=1)
        P7:rp_when(t=2)
    R1:body(rlen=17)
        B2:epilogue(t=3,ecount=0)

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 SECTION LOCAL  DEFAULT    1
     2: 00000000     0 SECTION LOCAL  DEFAULT    3
     3: 00000000     0 SECTION LOCAL  DEFAULT    4
     4: 00000000     0 SECTION LOCAL  DEFAULT    5
     5: 00000000     0 SECTION LOCAL  DEFAULT    6
     6: 00000000     0 SECTION LOCAL  DEFAULT    7
     7: 00000000     0 SECTION LOCAL  DEFAULT    9
     8: 00000000   112 FUNC    GLOBAL DEFAULT    1 func2
     9: 00000000     0 NOTYPE  GLOBAL HIDDEN  UND varTest
    10: 00000000     0 FUNC    GLOBAL DEFAULT  UND printf

No version information found in this file.



More information about the Binutils mailing list