This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Why does elf32-arm.h: elf32_arm_size_dynamic_sections strip out theoutput_section ?
- From: jeroen dobbelaere <jeroen dot dobbelaere at acunia dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 08 Nov 2002 12:26:47 +0100
- Subject: Why does elf32-arm.h: elf32_arm_size_dynamic_sections strip out theoutput_section ?
- Organization: ACUNIA
I was able to reduce the problem of the disappearing '.rel.dyn' section to the following :
In elf32-arm.h, elf32_arm_size_dynamic_sections :
there is a check to see if sections can be stripped out.
I have addded some printfs, and this shows that :
- at this moment, the '.rel.got' section is still present (with '.rel.dyn' as output section)
- this section is _not_ marked as 'strip it out'
BUT :
- another section '.rel.bss', (also '.rel.dyn' as output section) is present
- this section is being marked as 'strip it out'
- this results in stripping out the 'output section' !
For completeness : part of the debug output in size_dynamic_sections :
JDO: elf32_arm_size_dynamic_sections 0x99ab0 'test-dynamic4b'
JDO: pondering section 0xb479c '.text' (out : 0x9b5b4, '.text')
JDO: pondering section 0xb4830 '.data' (out : 0x9b804, '.data')
JDO: pondering section 0xb48c4 '.bss' (out : 0xa0e40, '.bss')
JDO: pondering section 0xb4958 '.init' (out : 0x9b48c, '.init')
JDO: pondering section 0xb49ec '.fini' (out : 0x9b648, '.fini')
JDO: pondering section 0xb4a80 '.comment' (out : 0xa0ffc, '.comment')
JDO: pondering section 0xb4b14 '.got' (out : 0xa0d18, '.got')
JDO: bfd_get_section_name returned '.got'
JDO: pondering section 0xb4ba8 '.got.plt' (out : 0xa0d18, '.got')
JDO: bfd_get_section_name returned '.got.plt'
JDO:** pondering section 0xb4c3c '.rel.got' (out : 0x9b364, '.rel.dyn')
JDO:** bfd_get_section_name returned '.rel.got'
JDO: pondering section 0xb4cd0 '.interp' (out : 0x9af58, '.interp')
JDO: bfd_get_section_name returned '.interp'
JDO: pondering section 0xb4d64 '.eh_frame_hdr' (out : 0x9b770, '.eh_frame_hdr')
JDO: bfd_get_section_name returned '.eh_frame_hdr'
JDO: pondering section 0xb4df8 '.gnu.version_d' (out : 0x9b23c, '.gnu.version_d')
JDO: bfd_get_section_name returned '.gnu.version_d'
JDO: pondering section 0xb4e8c '.gnu.version' (out : 0x9b1a8, '.gnu.version')
JDO: bfd_get_section_name returned '.gnu.version'
JDO: pondering section 0xb4f20 '.gnu.version_r' (out : 0x9b2d0, '.gnu.version_r')
JDO: bfd_get_section_name returned '.gnu.version_r'
JDO: pondering section 0xb4fb4 '.dynsym' (out : 0x9b080, '.dynsym')
JDO: bfd_get_section_name returned '.dynsym'
JDO: pondering section 0xb5048 '.dynstr' (out : 0x9b114, '.dynstr')
JDO: bfd_get_section_name returned '.dynstr'
JDO: pondering section 0xb50dc '.dynamic' (out : 0x9b92c, '.dynamic')
JDO: bfd_get_section_name returned '.dynamic'
JDO: pondering section 0xb5170 '.hash' (out : 0x9afec, '.hash')
JDO: bfd_get_section_name returned '.hash'
JDO: pondering section 0xb5204 '.plt' (out : 0x9b520, '.plt')
JDO: bfd_get_section_name returned '.plt'
JDO: pondering section 0xb5298 '.rel.plt' (out : 0x9b3f8, '.rel.plt')
JDO: bfd_get_section_name returned '.rel.plt'
JDO: pondering section 0xb532c '.dynbss' (out : 0xa0e40, '.bss')
JDO:** pondering section 0xb53c0 '.rel.bss' (out : 0x9b364, '.rel.dyn')
JDO:** bfd_get_section_name returned '.rel.bss'
JDO:** stripping 0xb53c0 '.rel.bss' (out 0x9b364 '.rel.dyn')
JDO: pondering section 0xb5454 '.glue_7' (out : 0x9b5b4, '.text')
JDO: pondering section 0xb54e8 '.glue_7t' (out : 0x9b5b4, '.text')
And here is what we do when a section is 'stripped' :
if (strip)
{
asection ** spp;
printf("JDO: stripping %p '%s' (out %p '%s')\n", s, s->name, s->output_section, s->output_section->name);
for (spp = &s->output_section->owner->sections;
*spp != NULL;
spp = &(*spp)->next)
{
if (*spp == s->output_section)
{
bfd_section_list_remove (s->output_section->owner, spp);
--s->output_section->owner->section_count;
break;
}
}
continue;
}
ALL sections with the same output_section are being stripped !
this can't be correct ??
Greetings,
--
Jeroen Dobbelaere
Embedded Software Engineer
ACUNIA Embedded Solutions
http://www.acunia.com/aes