This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Bug in ARM linker...
- To: ian at zembu dot com
- Subject: Re: Bug in ARM linker...
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Wed, 24 Nov 1999 11:01:11 GMT
- CC: scottb at netwinder dot org, pb at nexus dot co dot uk, patb at corel dot ca, binutils at sourceware dot cygnus dot com
Hi Guys,
: These 3 sections all share the SAME output section. I think this is the
: root cause of the problem. Somewhere along the way the flags for the
: output .text section are altered by the code. At any rate I believe
: this is the reason why the DT_TEXTREL tag is not output in the .dynamic
: section. The output .text section should be readonly for ELF.
:
: The linker script directs the linker to put the .glue sections in the
: .text section. This is normal behaviour.
:
: The bug is that the .glue sections are not marked SEC_READONLY, but
: presumably they should be. See bfd_elf32_arm_get_bfd_for_interworking
: in bfd/elf32-arm.h. Add SEC_READONLY and SEC_CODE to the flags passed
: to bfd_set_section_flags.
:
: Nick, let me know if that seems wrong.
Nope, I think that you are absolutely right.
Scott - try this patch and let me know if it solves your problem.
Cheers
Nick
1999-11-24 Nick Clifton <nickc@cygnus.com>
* elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add
SEC_CODE and SEC_READONLY flags to glue sections.
Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-arm.h,v
retrieving revision 1.25
diff -p -r1.25 elf32-arm.h
*** elf32-arm.h 1999/09/17 04:03:17 1.25
--- elf32-arm.h 1999/11/24 10:59:48
*************** bfd_elf32_arm_get_bfd_for_interworking (
*** 548,554 ****
/* Note: we do not include the flag SEC_LINKER_CREATED, as this
will prevent elf_link_input_bfd() from processing the contents
of this section. */
! flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
--- 548,554 ----
/* Note: we do not include the flag SEC_LINKER_CREATED, as this
will prevent elf_link_input_bfd() from processing the contents
of this section. */
! flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
*************** bfd_elf32_arm_get_bfd_for_interworking (
*** 566,572 ****
if (sec == NULL)
{
! flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);
--- 566,572 ----
if (sec == NULL)
{
! flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);