From: Kai Tietz <ktietz70@googlemail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>, Alan Modra <amodra@gmail.com>,
Nick Clifton <nickc@redhat.com>
Subject: Re: [patch ld bfd gas]: Handle linkonce for cfi generated debug_frame and eh_frame data
Date: Sun, 24 Apr 2011 10:20:00 -0000 [thread overview]
Message-ID: <BANLkTim3DpFxpY+yjuGExYWPZXRE3xwvag@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=SOrur_bPOMM5GKPtozYT0pw8vEw@mail.gmail.com>
2011/4/18 Kai Tietz <ktietz70@googlemail.com>:
> 2011/4/18 H.J. Lu <hjl.tools@gmail.com>:
>> On Mon, Apr 18, 2011 at 2:33 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>> Hello,
>>>
>>> The recent patch about this subject I withdraw and replace it by the
>>> more enhanced version. I noticed that a bit more checkings and a
>>> different approach on writing eh_frame/debug_frame sections out, was
>>> necessary. Additionally this patch allows for PE-COFF targets, that
>>> debugging sections can have link-once flags active.
>>>
>>>
>>> ChangeLog bfd/
>>>
>>> 2011-04-18 Kai Tietz
>>>
>>> * coffcode.h (sec_to_styp_flags): Allow linkonce for
>>> debugging sections.
>>>
>>> ChangeLog gas/
>>>
>>> 2011-04-18 Kai Tietz
>>>
>>> * dw2gencfi.c (dwcfi_seg_list): New struct.
>>> (dwcfi_hash): New static hash variable.
>>> (get_debugseg_name): New.
>>> (alloc_debugseg_item): New.
>>> (make_debug_seg): New.
>>> (dwcfi_hash_insert): New.
>>> (dwcfi_hash_find): New.
>>> (dwcfi_hash_find_or_make): New.
>>> (cfi_insn_data): New member cur_seg.
>>> (cie_entry): Likewise.
>>> (fde_entry): New cseg and handled members.
>>> (alloc_fde_entry): Initialize cseg member.
>>> (alloc_cfi_insn_data): Initialize cur_seg member.
>>> (dot_cfi_sections): Compare for beginning of
>>> section names via strncmp.
>>> (get_cfi_seg): New.
>>> (cfi_finish): Treat link-once sections.
>>> (is_now_linkonce_segment): New local helper.
>>> (output_cie): Ignore cie entries not member of current
>>> segment.
>>> (output_fde): Likewise.
>>> (select_cie_for_fde): Likewise.
>>> (cfi_change_reg_numbers): Add new argument for current segment
>>> and ignore insn elements, if not part of current segment.
>>> * ehopt.c (get_cie_info): Use strncmp for
>>> section name matching.
>>> (heck_eh_frame): Likewise.
>>>
>>> ChangeLog ld/
>>>
>>> 2011-04-18 Kai Tietz
>>>
>>> * scripttempl/alphavms.sc: Handle .eh_frame($|.)* sections.
>>> * scripttempl/armbpabi.sc: Likewise.
>>> * scripttempl/avr.sc: Likewise.
>>> * scripttempl/crisaout.sc: Likewise.
>>> * scripttempl/elf.sc: Likewise.
>>> * scripttempl/elf32cr16.sc: Likewise.
>>> * scripttempl/elf32crx.sc: Likewise.
>>> * scripttempl/elf32msp430.sc: Likewise.
>>> * scripttempl/elf32msp430_3.sc: Likewise.
>>> * scripttempl/elf32sh-symbian.sc: Likewise.
>>> * scripttempl/elf64hppa.sc: Likewise.
>>> * scripttempl/elf_chaos.sc: Likewise.
>>> * scripttempl/elfd10v.sc: Likewise.
>>> * scripttempl/elfd30v.sc: Likewise.
>>> * scripttempl/elfi370.sc: Likewise.
>>> * scripttempl/elfm68hc11.sc: Likewise.
>>> * scripttempl/elfm68hc12.sc: Likewise.
>>> * scripttempl/elfmicroblaze.sc: Likewise.
>>> * scripttempl/elfxtensa.sc: Likewise.
>>> * scripttempl/epocpe.sc: Likewise.
>>> * scripttempl/i386beos.sc: Likewise.
>>> * scripttempl/i386go32.sc: Likewise.
>>> * scripttempl/ip2k.sc: Likewise.
>>> * scripttempl/iq2000.sc: Likewise.
>>> * scripttempl/mcorepe.sc: Likewise.
>>> * scripttempl/mep.sc: Likewise.
>>> * scripttempl/mmo.sc: Likewise.
>>> * scripttempl/pe.sc: Likewise.
>>> * scripttempl/pep.sc: Likewise.
>>> * scripttempl/v850.sc: Likewise.
>>> * scripttempl/xstormy16.sc: Likewise.
>>>
>>> Tested for x86_64-w64-mingw32, i686-w64-mingw32, and i686-pc-cygwin.
>>> Ok for apply?
>>
>> 2 comments:
>>
>> 1. You should test Linux/x86 since you change ELF targets.
>> 2. You should add some testcases to show gas/ld work correctly.
>>
>>
>> --
>> H.J.
>>
>
> I tested things for x86_64-pc-linux-gnu and found that the linkonce
> code collides with eh_frame_hdr code in bfd. So I removed complete ELF
> handling here and just enable cfi linkonce handling for PE-COFF
> targets.
>
> ChangeLog bfd/
>
> 2011-04-18 Kai Tietz
>
> * coffcode.h (sec_to_styp_flags): Allow linkonce for
> debugging sections.
>
> ChangeLog gas/
>
> 2011-04-18 Kai Tietz
>
> * dw2gencfi.c (dwcfi_seg_list): New struct.
> (dwcfi_hash): New static hash variable.
> (get_debugseg_name): New.
> (alloc_debugseg_item): New.
> (make_debug_seg): New.
> (dwcfi_hash_insert): New.
> (dwcfi_hash_find): New.
> (dwcfi_hash_find_or_make): New.
> (cfi_insn_data): New member cur_seg.
> (cie_entry): Likewise.
> (fde_entry): New cseg and handled members.
> (alloc_fde_entry): Initialize cseg member.
> (alloc_cfi_insn_data): Initialize cur_seg member.
> (dot_cfi_sections): Compare for beginning of
> section names via strncmp.
> (get_cfi_seg): New.
> (cfi_finish): Treat link-once sections.
> (is_now_linkonce_segment): New local helper.
> (output_cie): Ignore cie entries not member of current
> segment.
> (output_fde): Likewise.
> (select_cie_for_fde): Likewise.
> (cfi_change_reg_numbers): Add new argument for current segment
> and ignore insn elements, if not part of current segment.
> * ehopt.c (get_cie_info): Use strncmp for
> section name matching.
> (heck_eh_frame): Likewise.
>
> ChangeLog ld/
>
> 2011-04-18 Kai Tietz
>
> * scripttempl/pe.sc: Likewise.
> * scripttempl/pep.sc: Likewise.
>
> ChangeLog ld/testsuite/
>
> 2011-04-18 Kai Tietz
>
> * ld-pe/pe.exp: Add cfi/cfi32 tests.
> * ld-pe/cfi.d: New.
> * ld-pe/cfi32.d: New.
> * ld-pe/cfia.s: New.
> * ld-pe/cfib.s: New.
>
> I added a testcase for pe and pe+ and regression tested it for
> i686-w64-mingw32, i686-pc-cygwin, x86_64-w64-mingw32, and
> x86_64-pc-linux-gnu. Ok for apply?
>
> Regards,
> Kai
>
PING
next prev parent reply other threads:[~2011-04-24 10:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-18 9:34 Kai Tietz
2011-04-18 12:43 ` H.J. Lu
2011-04-18 20:04 ` Kai Tietz
2011-04-24 10:20 ` Kai Tietz [this message]
2011-04-26 15:29 ` Nick Clifton
2011-04-27 20:35 ` gas -Werror compilation break [Re: [patch ld bfd gas]: Handle linkonce for cfi generated debug_frame and eh_frame data] Jan Kratochvil
2011-05-05 0:29 ` Dave Korn
2011-05-05 8:45 ` Alan Modra
2011-05-05 13:21 ` Alan Modra
2011-05-06 17:58 ` Dave Korn
2011-05-07 2:53 ` Alan Modra
2011-05-05 8:50 ` Kai Tietz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTim3DpFxpY+yjuGExYWPZXRE3xwvag@mail.gmail.com \
--to=ktietz70@googlemail.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=nickc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).