bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/32264] For Windows,`.CRT` section should be merged into `.rdata`


From: lh_mouse at 126 dot com
Subject: [Bug ld/32264] For Windows,`.CRT` section should be merged into `.rdata`
Date: Sun, 03 Nov 2024 08:09:35 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=32264

--- Comment #7 from LIU Hao <lh_mouse at 126 dot com> ---
Created attachment 15776
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15776&action=edit
final patch 2/2

The previous broke pseudo relocation because it expected pseudo relocation list
ended immediately after `.rdata`. The patch removes `__rt_psrelocs_size ` and
aliases `__RUNTIME_PSEUDO_RELOC_LIST_END__` directly to `__rt_psrelocs_end`.

```
  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
  {
    ${R_RDATA}
    . = ALIGN(4);
    ${RELOCATING+__rt_psrelocs_start = .;}
    ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
    ${RELOCATING+__rt_psrelocs_end = .;}
  }
  ${RELOCATING+__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;}
  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
```


Damn how did you create a thing like that?

```
commit 730035f7afaff40fa613348abd5a087319f1cb45
Author: Dave Korn <dave.korn@artimi.com>
Date:   2011-05-07 14:29:10 +0000

    bfd/ChangeLog:

            PR ld/12365
            * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
            references to symbols defined in discarded sections.

    ld/ChangeLog:

            PR ld/12365
            * scripttempl/pe.sc (__rt_psrelocs_start): New symbol definition.
            (__rt_psrelocs_end): Likewise.
            (__rt_psrelocs_size): Likewise difference between the above.
            (__RUNTIME_PSEUDO_RELOC_LIST_END__): Move outside .rdata section
            immediately after end of pseudo-reloc data.
            (___RUNTIME_PSEUDO_RELOC_LIST_END___): Likewise.
            (__RUNTIME_PSEUDO_RELOC_LIST__): Move outside .rdata section and
            calculate backward from list end.
            (___RUNTIME_PSEUDO_RELOC_LIST___): Likewise.
            * scripttempl/pep.sc: Likewise.

    ld/testsuite/ChangeLog:

            PR ld/12365
            * ld-plugin/plugin-7.d: Allow underscore in error message.
            * ld-plugin/plugin-8.d: Likewise.
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]