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]

Re: [RFC PATCH, binutils, ARM 4/11, ping] Use getters/setters to access ARM branch type


On Wednesday 30 March 2016 15:41:42 Nick Clifton wrote:
> Hi Thomas,
> 
> > Ping?
> 
> Oops - sorry.
> 
> >> *** bfd/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          * elf32-arm.c (elf32_arm_size_stubs): Use new macros
> >>          ARM_GET_SYM_BRANCH_TYPE and ARM_SET_SYM_BRANCH_TYPE to
> >>          respectively
> >> 
> >> get and set branch type of a symbol.
> >> 
> >>          (bfd_elf32_arm_process_before_allocation): Likewise.
> >>          (elf32_arm_relocate_section): Likewise and fix identation along
> >>          the
> >>          way.
> >>          (allocate_dynrelocs_for_symbol): Likewise.
> >>          (elf32_arm_finish_dynamic_symbol): Likewise.
> >>          (elf32_arm_swap_symbol_in): Likewise.
> >>          (elf32_arm_swap_symbol_out): Likewise.
> >> 
> >> *** gas/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          * config/tc-arm.c (arm_adjust_symtab): Use
> >>          ARM_SET_SYM_BRANCH_TYPE
> >> 
> >> to set branch type of a symbol.
> >> 
> >> 
> >> *** include/elf/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          * arm.h (ARM_SYM_BRANCH_TYPE): Replace by ...
> >>          (ARM_GET_SYM_BRANCH_TYPE): ... this ...
> >>          (ARM_SET_SYM_BRANCH_TYPE): ... and this.
> >> 
> >> *** ld/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          (gld${EMULATION_NAME}_finish): Use ARM_GET_SYM_BRANCH_TYPE to
> >>          get
> >>          branch type of a symbol.
> >> 
> >> *** opcodes/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          * arm-dis.c (get_sym_code_type): Use ARM_GET_SYM_BRANCH_TYPE to
> >>          get
> >>          branch type of a symbol.
> >>          (print_insn): Likewise.
> 
> Approved - please apply - but ...
> 
> >> *** gdb/ChangeLog ***
> >> 
> >> 2015-12-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >> 
> >>          * arm-tdep.c (arm_elf_make_msymbol_special): Use
> >>          ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.
> 
> This change will need approval from a GDB maintainer.

Yes of course, I'll submit to gdb as well.
> 
> >> -#define ARM_SYM_BRANCH_TYPE(SYM) \
> >> -  ((enum arm_st_branch_type) (SYM)->st_target_internal)
> >> +#define ARM_GET_SYM_BRANCH_TYPE(SYM_TARGET_INTERNAL) \
> >> +  ((enum arm_st_branch_type) ((SYM_TARGET_INTERNAL) & 3))
> >> +#define ARM_SET_SYM_BRANCH_TYPE(SYM_TARGET_INTERNAL,TYPE) \
> >> +  ((SYM_TARGET_INTERNAL) = ((SYM_TARGET_INTERNAL) & ~3) | ((TYPE) & 3))
> 
> It occurs to me that an out-of-range value for the TYPE parameter to the
> ARM_SET_SYM_BRANCH_TYPE macro ought to be flagged as an error, and not
> silently truncated.  You could probably let the compiler's enum checking do
> this...

Any advice on how to catch any growth in terms of enum size? The point is for 
later commit [1] to start using currently unused bits but we need to make sure 
these new macros are updated if branch type enum increase in size.

[1] https://sourceware.org/ml/binutils/2016-03/msg00379.html

Best regards,

Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]