This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Fix type and alignment of ARM/Thumb EABImapping symbols
On Tue, 2005-03-29 at 22:26, Julian Brown wrote:
> OK, this is a simpler version of the patch which alters the expected
> test output instead (only ARM-specific code is now touched).
>
> Tested with cross to arm-none-eabi and arm-none-symbianelf, and with all
> targets on i686-pc-linux-gnu. OK to apply?
>
> ChangeLog:
>
> * bfd/elf32-arm.c (arm_elf_find_function): Include STT_NOTYPE in test
> for mapping symbols.
> * gas/config/tc-arm.c (mapping_state): Update documentation in
> function comment. Change type of mapping symbols to BSF_NO_TYPE.
> (is_arm_mapping_symbol_name): New function.
> (arm_adjust_symtab): Don't change type of mapping symbols here.
> * gas/testsuite/gas/arm/mapping.d: Update expected output.
> * ld/testsuite/ld-arm/arm-app-abs32.d: Likewise.
> * ld/testsuite/ld-arm/arm-app.d: Likewise.
> * ld/testsuite/ld-arm/mixed-app.d: Likewise.
>
> ______________________________________________________________________
> Index: gas/config/tc-arm.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-arm.c,v
> retrieving revision 1.199
> diff -c -p -r1.199 tc-arm.c
> *** gas/config/tc-arm.c 29 Mar 2005 16:54:21 -0000 1.199
> --- gas/config/tc-arm.c 29 Mar 2005 21:13:47 -0000
> *************** validate_offset_imm (unsigned int val, i
> *** 1243,1316 ****
> --- 1243,1308 ----
>
> #ifdef OBJ_ELF
> /* This code is to handle mapping symbols as defined in the ARM ELF spec.
> ! (This text is taken from version 0.62 RC 2 of the spec):
>
> ! 4.5.7 Mapping symbols
>
> ! A section of an ELF file can contain a mixture of ARM code, Thumb code
There's no need to quote the entirety of this section in the source
file. A cross reference is fine. The correct reference should be to
v1.0 of the spec, where the section number is 4.5.5.
> *************** arm_frob_label (symbolS * sym)
> *** 13678,13683 ****
> --- 13670,13685 ----
> }
> }
>
> + /* Recognize short-form or long-form mapping symbol names. */
> +
> + static bfd_boolean
> + is_arm_mapping_symbol_name (const char* name)
> + {
> + return name && name[0] == '$'
> + && (name[1] == 'a' || name[1] == 'd' || name[1] == 't')
> + && (name[2] == '\0' || name[2] == '.');
> + }
> +
> /* Adjust the symbol table. This marks Thumb symbols as distinct from
> ARM ones. */
>
It seems silly to duplicate this function here when it also exists in
libbfd (though also static). It would make more sense to make the bfd
implementation public and call that. I would suggest you move the code
to cpu-arm.c.
This is ok with the above changes.
R.