This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Fri, Oct 3, 2008 at 2:46 AM, Alan Modra <amodra@bigpond.net.au> wrote: > The elf.c and elflink.c patches below teach the ELF backend linker to > handle group signature symbols for ld -r. The genelf.em patch does > the same for ELF targets that use the generic linker. > > The linker.c change fixes the group section contents for the generic > linker, a nasty hack but nothing else seemed nice either. Prior to > this change, the generic linker simply copied group section contents > to output for ld -r, which, since section indices almost always > change, broke groups. The generic linker also mashed together group > sections due to lack of unique sections for groups. Moving this logic > from elf32.em into ldlang.c cures that particular problem. > > Finally, I tweaked the various emulation's place_orphan code to not > use an existing output section statement if it did not already have a > bfd section. This is because a new bfd section will be created after > all other existing sections, which is probably the wrong ordering. > lang_place_orphan knows how to rearrange sections. > > bfd/ > * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when > the signature symbol is global. > * elflink.c (elf_link_input_bfd): Ensure group signature symbol > is output when ld -r. Set group sh_info when local. > * linker.c (default_indirect_link_order): Handle group sections > specially. > ld/ > * ldemul.c (ldemul_place_orphan): Add "name" param. > * ldemul.h (ldemul_place_orphan): Update prototype. > (struct ld_emulation_xfer_struct <place_orphan>): Likewise. > * ldlang.c (lang_place_orphans): Generate unique section names here.. > * emultempl/elf32.em (place_orphan): ..rather than here. Don't > directly use an existing output section statement that has no > bfd section. > * emultempl/pe.em (place_orphan): Likewise. > * emultempl/pep.em (place_orphan): Likewise. > * emultempl/beos.em (place_orphan): Adjust. > * emultempl/spuelf.em (spu_place_special_section): Adjust > place_orphan call. > * emultempl/genelf.em (gld${EMULATION_NAME}_after_open): New function. > (LDEMUL_AFTER_OPEN): Define. > It is unsafe to use an existing section symbol as group signature since "ld -r" may change section symbol if there is a duplicate. This patch disallows using section symbol as group signature. OK to install? -- H.J. --- bfd/ 2008-10-03 H.J. Lu <hongjiu.lu@intel.com> PR ld/6931 * elflink.c (elf_link_input_bfd): Disallow using section symbol as group signaure. binutils/testsuite/ 2008-10-03 H.J. Lu <hongjiu.lu@intel.com> PR ld/6931 * binutils-all/group-2.s: Don't use section symbol as group signature. * binutils-all/strip-5.d: Updated. gas/ 2008-10-03 H.J. Lu <hongjiu.lu@intel.com> PR ld/6931 * config/obj-elf.c (elf_frob_file): Disallow using section symbol as group signature. gas/testsuite/ 2008-10-03 H.J. Lu <hongjiu.lu@intel.com> PR ld/6931 * gas/elf/elf.exp: Run group2. * gas/elf/group2.l: New. * gas/elf/group2.s: Likewise. ld/testsuite/ 2008-10-03 H.J. Lu <hongjiu.lu@intel.com> PR ld/6931 * ld-elf/group4.d: Updated. * ld-elf/group7.d: New.
Attachment:
binutils-grp-3.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |