This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix one more place_orphan problem
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 23 Oct 2002 18:57:53 +0200
- Subject: [PATCH] Fix one more place_orphan problem
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Without the following patch, ld creates on alpha (and other arches which
want to emit non-alloced .rel* sections) bogus sections like:
[34] .rela.dyn.1 RELA 0000000000000000 0abe00 000408 18 3 0 8
[35] .rela.dyn.2 RELA 0000000000000000 0ac208 11a198 18 3 0 8
[36] .rela.dyn.3 RELA 0000000000000000 1c63a0 0007e0 18 3 0 8
[37] .rela.dyn.4 RELA 0000000000000000 1c6b80 0007b0 18 3 0 8
[38] .rela.dyn.5 RELA 0000000000000000 1c7330 0003c0 18 3 0 8
which confuses e.g. strip, because there are no .dyn.1, .dyn.2 etc. sections
and only .rela.dyn (and .rel.dyn) is special.
2002-10-23 Jakub Jelinek <jakub@redhat.com>
* emultempl/elf32.em (place_orphan): Don't put non-allocated .rel*
sections into .rel{,a}.dyn.
--- ld/emultempl/elf32.em.jj 2002-10-10 09:50:15.000000000 +0200
+++ ld/emultempl/elf32.em 2002-10-23 18:32:27.000000000 +0200
@@ -1098,6 +1098,7 @@ gld${EMULATION_NAME}_place_orphan (file,
secname = bfd_get_section_name (s->owner, s);
if (! link_info.relocateable
&& link_info.combreloc
+ && (s->flags & SEC_ALLOC)
&& strncmp (secname, ".rel", 4) == 0)
{
if (secname[4] == 'a')
Jakub