PATCH: PR ld/14105: Always create PLT eh_frame

H.J. Lu hjl.tools@gmail.com
Mon May 21 14:40:00 GMT 2012


On Mon, May 21, 2012 at 2:45 AM, Alan Modra <amodra@gmail.com> wrote:
> On Sun, May 13, 2012 at 02:36:51PM -0700, H.J. Lu wrote:
>> 2012-05-13  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>       PR ld/14105
>>       * elf32-i386.c (elf_i386_create_dynamic_sections): Always
>>       create PLT eh_frame section with SEC_LINKER_CREATED.
>>       * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
>>
>>       * elflink.c (not_this_section): New.
>>       (bfd_elf_discard_info): Also handle PLT eh_frame created by
>>       linker.
>
> The elflink.c changes should not be necessary.  Please see how
> elf32-ppc.c handles this.  Search for glink_eh_frame.
>
> $ gcc -O2 -fpic -fexceptions -c /src/tmp/pr14105.c
> $ readelf -S --wide pr14105.o | grep eh_frame
>  [ 8] .eh_frame         PROGBITS        00000000 0000b0 000034 00   A  0   0  4
>  [ 9] .rela.eh_frame    RELA            00000000 000468 00000c 0c     11   8  4
> $ ld/ld-new -shared -o pr14105.so pr14105.o
> $ readelf -wf pr14105.so
> Contents of the .eh_frame section:
>
> 00000000 00000010 00000000 CIE
>  Version:               1
>  Augmentation:          "zR"
>  Code alignment factor: 4
>  Data alignment factor: -4
>  Return address column: 65
>  Augmentation data:     1b
>
>  DW_CFA_def_cfa: r1 ofs 0
>
> 00000014 0000001c 00000018 FDE cie=00000000 pc=00000190..000001c8
>  DW_CFA_advance_loc: 4 to 00000194
>  DW_CFA_def_cfa_offset: 32
>  DW_CFA_advance_loc: 8 to 0000019c
>  DW_CFA_register: r65 in r0
>  DW_CFA_advance_loc: 12 to 000001a8
>  DW_CFA_offset_extended_sf: r65 at cfa+4
>  DW_CFA_offset: r30 at cfa-8
>  DW_CFA_nop
>  DW_CFA_nop
>
> 00000034 00000010 00000000 CIE
>  Version:               1
>  Augmentation:          "zR"
>  Code alignment factor: 4
>  Data alignment factor: -4
>  Return address column: 65
>  Augmentation data:     1b

My elflink.c change is to remove the redundant CIE above.

>  DW_CFA_def_cfa: r1 ofs 0
>
> 00000048 00000014 00000018 FDE cie=00000034 pc=000001d0..00000220
>  DW_CFA_advance_loc: 24 to 000001e8
>  DW_CFA_register: r65 in r0
>  DW_CFA_advance_loc: 16 to 000001f8
>  DW_CFA_restore_extended: r65
>

-- 
H.J.



More information about the Binutils mailing list