Reverse copy .ctors/.dtors sections if needed.
commit0df7bac224004772a380db3e3b29933c16411940
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 7 May 2011 14:12:56 +0000 (7 14:12 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 7 May 2011 14:12:56 +0000 (7 14:12 +0000)
treef6fed679981a439d1fcb08bc22748d0b24144955
parentc2012de93bb70577592c285d045f420312bf53bc
Reverse copy .ctors/.dtors sections if needed.

bfd/

2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/12730
* elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY.

* elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors
sections if needed.

* section.c (SEC_ELF_REVERSE_COPY): New.
* bfd-in2.h: Regenerated.

ld/testsuite/

2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/12730
* ld-elf/elf.exp (array_tests): Add "pr12730".
(array_tests_pie): New.
(array_tests_static): Add -static for "static init array mixed".
Add "static pr12730".  Run array_tests_pie for Linux.

* ld-elf/init-mixed.c (ctor1007): Renamed to ...
(ctor1007a): This.
(ctor1007b): New.
(ctors1007): Remove ctor1007.  Add ctor1007b and ctor1007a.
(dtor1007): Renamed to ...
(dtor1007a): This.
(dtor1007b): New.
(dtors1007): Remove dtor1007.  Add dtor1007b and dtor1007a.
(ctor65535): Renamed to ...
(ctor65535a): This.
(ctor65535b): New.
(ctors65535): Remove ctor65535.  Add ctor65535b and ctor65535a.
(dtor65535): Renamed to ...
(dtor65535a): This.
(dtor65535b): New.
(dtors65535): Remove dtor65535.  Add dtor65535b and dtor65535a.

* ld-elf/pr12730.cc: New.
* ld-elf/pr12730.out: Likewise.
bfd/ChangeLog
bfd/bfd-in2.h
bfd/elf.c
bfd/elflink.c
bfd/section.c
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/init-mixed.c
ld/testsuite/ld-elf/pr12730.cc [new file with mode: 0644]
ld/testsuite/ld-elf/pr12730.out [new file with mode: 0644]