This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dw2gencfi rewrite


Richard Henderson <rth@redhat.com> writes:

> On Sun, Jun 01, 2003 at 10:02:13AM +0200, Andreas Jaeger wrote:
>> $ readelf -wf signal/kill.os
> ...
>> 00000018 00000014 0000001c FDE cie=00000000 pc=00000020..00000047
> ...
>> I applied both your dw2gencfi and your readelf patches,
>
> Even with my readelf patch you won't get REALLY correct
> output from an object file, since we don't apply relocs.
>
> Do "ld -e kill -o foo signal/kill.os" or something and
> see if you get the proper results then.

This looks of-by-three now:

$ ld -e kill -o foo signal/kill.os -lc
$ readelf -wf foo
The section .eh_frame contains:

00000000 00000014 00000000 CIE
  Version:               1
  Augmentation:          "zR"
  Code alignment factor: 1
  Data alignment factor: -8
  Return address column: 16
  Augmentation data:     1b

  DW_CFA_def_cfa: r7 ofs 8
  DW_CFA_offset: r16 at cfa-8
  DW_CFA_nop
  DW_CFA_nop

00000018 00000014 0000001c FDE cie=00000000 pc=0040025c..00400283
  DW_CFA_advance_loc: 25 to 00400275
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 6 to 0040027b
  DW_CFA_def_cfa_offset: 8
  DW_CFA_nop

$ objdump -d foo

foo:     file format elf64-x86-64

Disassembly of section .plt:

0000000000400240 <.plt>:
  400240:       ff 35 ba 01 10 00       pushq  1049018(%rip)        # 500400 <_GLOBAL_OFFSET_TABLE_+0x8>
  400246:       ff 25 bc 01 10 00       jmpq   *1049020(%rip)        # 500408 <_GLOBAL_OFFSET_TABLE_+0x10>
  40024c:       90                      nop    
  40024d:       90                      nop    
  40024e:       90                      nop    
  40024f:       90                      nop    
  400250:       ff 25 ba 01 10 00       jmpq   *1049018(%rip)        # 500410 <_GLOBAL_OFFSET_TABLE_+0x18>
  400256:       68 00 00 00 00          pushq  $0x0
  40025b:       e9 e0 ff ff ff          jmpq   400240 <__GI___kill-0x20>
Disassembly of section .text:

0000000000400260 <__GI___kill>:
  400260:       48 c7 c0 3e 00 00 00    mov    $0x3e,%rax
  400267:       0f 05                   syscall 
  400269:       48 3d 01 f0 ff ff       cmp    $0xfffffffffffff001,%rax
  40026f:       73 01                   jae    400272 <__GI___kill+0x12>
  400271:       c3                      retq   
  400272:       48 31 d2                xor    %rdx,%rdx
  400275:       48 29 c2                sub    %rax,%rdx
  400278:       52                      push   %rdx
  400279:       e8 d2 ff ff ff          callq  400250 <__GI___kill-0x10>
  40027e:       5a                      pop    %rdx
  40027f:       89 10                   mov    %edx,(%rax)
  400281:       48 83 c8 ff             or     $0xffffffffffffffff,%rax
  400285:       eb ea                   jmp    400271 <__GI___kill+0x11>

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]