This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch x64 SEH]: Support xdata/pdata for link-once code
On 09/13/2010 01:25 AM, Kai Tietz wrote:
> +/* Private segment collection list. */
> +struct seh_seg_list {
> + struct seh_seg_list *next;
> + segT seg;
> + int subseg;
> +};
I think we'd be better off using either "splay-tree.h" or
"hashtab.h" from libiberty.
> + /* Check if code segment is marked as linked once. */
> + flags = bfd_get_section_flags (stdoutput, seg);
> + flags &= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD | SEC_LINK_DUPLICATES_ONE_ONLY
> + | SEC_LINK_DUPLICATES_SAME_SIZE | SEC_LINK_DUPLICATES_SAME_CONTENTS;
...
> + /* Apply possibly lined once flags to new generated segment, too. */
> + flags |= bfd_get_section_flags (stdoutput, in->seg);
Separating these two bits of code is confusing. I initially
wrote a sentence saying you weren't masking off the bits
properly. That said, I don't think you really need to
propagate default flags from .[px]data itself. Just OR in
SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA.
r~