cc: assembler failed for tmp-divrem_2.s

Dennis Clarke dclarke at blastwave.org
Mon Mar 29 15:37:06 CEST 2010


> Dennis Clarke <dclarke at blastwave.org> writes:
>
>           "hack.s", line 1 : Syntax error
>           Near line: "    .section        ".text""
>
> Swell.  It doesn't even recog plain elf sectioning commands.  That's
> actually very strange.  If you compile something to ".o", say the
> attached program, and then run "file foo.o", does it say ELF-something?
>
> I take it that the attached program passes.  Please confirm.

$ cat -n hack2.s
     1          .text
     2          .globl  main
     3  main:   orb     %dl, %al
     4          andb    %dl, %al
     5          xorb    %dl, %al
     6          ret
$ cc -o hack2 hack2.s
$ file hack2
hack2:          ELF 32-bit LSB executable 80386 Version 1, dynamically
linked, not stripped

$ elfdump -d hack2

Dynamic Section:  .dynamic
     index  tag               value
       [0]  NEEDED           0x108             libc.so.1
       [1]  INIT             0x80506a0
       [2]  FINI             0x80506bc
       [3]  RUNPATH          0x12e             /usr/local/lib
       [4]  RPATH            0x12e             /usr/local/lib
       [5]  HASH             0x8050118
       [6]  STRTAB           0x8050388
       [7]  STRSZ            0x13d
       [8]  SYMTAB           0x80501f8
       [9]  SYMENT           0x10
      [10]  CHECKSUM         0x4d2e
      [11]  VERNEED          0x80504c8
      [12]  VERNEEDNUM       0x1
      [13]  TEXTREL          0
      [14]  PLTRELSZ         0x28
      [15]  PLTREL           0x11
      [16]  JMPREL           0x8050508
      [17]  REL              0x80504f8
      [18]  RELSZ            0x38
      [19]  RELENT           0x8
      [20]  DEBUG            0
      [21]  FEATURE_1        0x1               [ PARINIT ]
      [22]  SUNW_CAP         0x8050108
      [23]  FLAGS            0x4               [ TEXTREL ]
      [24]  FLAGS_1          0                 0
      [25]  PLTGOT           0x80606dc

$ elf_i386 hack2
Valid ELF descriptor found.
elf32|64_getehdr(elf) looks good !
elf_getscn(elf, ehdr{64}->e_shstrndx) returns valid data!
elf_getdata can read into that valid data just fine too!
[1]    .interp
[2]    .SUNW_cap
[3]    .hash
[4]    .dynsym
[5]    .dynstr
[6]    .SUNW_version
[7]    .rel.text
[8]    .rel.data
[9]    .rel.plt
[10]    .plt
[11]    .text
[12]    .init
[13]    .fini
[14]    .rodata
[15]    .got
[16]    .dynamic
[17]    .data
[18]    .bssf
[19]    .bss
[20]    .symtab
[21]    .strtab
[22]    .comment
[23]    .shstrtab


-- 
Dennis Clarke
dclarke at opensolaris.ca  <- Email related to the open source Solaris
dclarke at blastwave.org   <- Email related to open source for Solaris




More information about the gmp-bugs mailing list