avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [PATCH] Atmega256x support with bootloader handling


From: Björn Haase
Subject: [avr-libc-dev] [PATCH] Atmega256x support with bootloader handling
Date: Mon, 1 May 2006 21:10:10 +0200
User-agent: KMail/1.7.1

Hi,

I have incorporated the changes according to Marek's suggestions for 
bootloader development and fixed some small problems. E.g. the avr6 target 
was missing in gcc's list of -mmcu= parameters.

The attached patches are against current head of gcc and binutils.

Yours,

Bjoern.

Summary of the changes to the binutils:

The template used for implementing the linker stubs for avr was the hppa
target. The difference here is, that we are having only one single
stub section that is created at the very beginning in the linker emulation
template. The placement of this stub section is controlled by it's name that
is included in the scripttemplate. It will be linked right after the 
section used for initializing the contents of the .data section.

In order to implement this, it was necessary to add support for a derived
linker hash table and an additional stub hash table.

avr-ld now is aware of new target specific options (documented in the
avr-ld --help output):

The two options

 --no-call-ret-replacement
 --pmem-wrap-around

control the linker relaxation optimizations. When defining 
--pm-wrap-around=16k,
the linker now tries to shorten jumps from absolute 14k to absolute 1k by 
using
the fact that the PC wraps around when using a shorter relative jump.
This is, IMO, useful only for the 16k and 32k devices. 

When using --no-stubs, the linker will not generate the jump stubs even when
using an avr6 device.

By use of the --debug-stubs and --debug-relax switches one could activate
debugging printout to stdout that is meant to be used when debugging avr-ld 
itself. It's not meant to be used by the user, but documented never the less.


Yours,

Bjoern.


Change log for the binutils part:

2005-05-01  Bjoern Haase  <address@hidden> 

        * bfd/archures.c
        bfd_mach_avr6: add.
        
        * bfd/bfd-in2.h
        bfd_mach_avr6: add.
        
        * bfd/cpu-avr.c
        bfd_mach_avr6: add.
        
        * bfd/elf32-avr.h: new file
        
        * bfd/elf32-avr.c
        Add elf32-avr.h to include list.
        elf32_avr_stub_hash_entry: add.
        elf32_avr_link_hash_table: add.
        avr_link_hash_table: add.
        avr_stub_hash_entry: add.
        avr_stub_hash_lookup: add.
        stub_hash_newfunc: add.
        elf32_avr_link_hash_table_create: add.
        elf32_avr_link_hash_table_free: add.
        avr_get_stub_addr: add.
        debug_relax, debug_stubs: add.
        avr_pc_wrap_around: Change type to bfd_vma.
        avr_replace_call_ret_sequences: add.
        avr_stub_is_required_for_16_bit_reloc: add.
        avr_final_link_relocate: 
        Add linker hashtable to parameter list. Use stub addr. if necessary.
        elf32_avr_relocate_section:
        Add linker hashtable to parameter list of avr_final_link_relocate.
        bfd_elf_avr_final_write_processing:
        Add handling for bfd_mach_avr6.
        elf32_avr_object_p:
        Add support for E_AVR_MACH_AVR6.
        elf32_avr_relax_delete_bytes:
        Iterate over all sections of a bfd when adjusting relocs addends.
        elf32_avr_relax_section:
        Use avr_replace_call_ret_sequences, recalculate size of stub section.
        avr_stub_name: add.
        avr_get_stub_addr: add.
        avr_get_stub_entry: add.
        avr_add_stub: add.
        avr_build_one_stub: add.
        avr_size_one_stub: add.
        elf32_avr_setup_params: add.
        elf32_avr_setup_section_lists: add.
        get_local_syms: add.
        elf32_avr_size_stubs: add.
        bfd_elf32_bfd_link_hash_table_create: add.
        bfd_elf32_bfd_link_hash_table_free: add
        
        * gas/config/tc-avr.c: add avr6, avr2560 and avr2561
        
        * gas/config/tc-avr.h:
        TC_VALIDATE_FIX: Don't generate fixups for PM type relocs
        
        * include/elf/avr.h
        E_AVR_MACH_AVR6: add.
        
        * ld/configure.tgt: Add avr6 to emulation list.
        
        * ld/Makefile.am, ld/Makefile.in:
        Add eavr6.o and corresponding rule.
        
        * ld/emulparams/avr6.sh: add
        
        * ld/emulparams/avrX.sh:
        TEMPLATE_NAME: Change to elf32 instead of generic.
        EXTRA_EM_FILE: add reference to new avrelf.
        
        * ld/scripttempl/avr.sc: Add ".trampolines" section.
        
        * ld/emultampl/avrelf.em: New file.


Change log for the gcc part:

        * gcc/gcc/config/avr/avr.c:
        avr_pc_size: add
        struct base_arch: add three_byte_pc to struct.
        struct base_arch_s: add new struct member and add avr6 entry.
        struct mcu_type_s: add atmega2560 and atmega2561.
        avr_override_options: set avr_pc_size to 3 if necessary.
        initial_elimination_offset: use (avr_pc_size) instead of fixed value 2.

        * gcc/gcc/config/avr/avr.h:
        CC1_SPEC: add -fno-delete-null-pointer-checks to list.
        CC1PLUS_SPEC: ditto.
        LINK_SPEC: add atmega2560 and atmega2561
        CRT_BINUTILS_SPEC: 
        add atmega2560 (crtm2560.o) and atmega2561 (crtm2561.o).

        * gcc/gcc/config/avr/t-avr:
        MULITLIB_OPTIONS: add avr6 architecture to list
        MULITLIB_DIRNAMES: ditto. 
        MULTILIB_MATCHES: add atmega2560 and atmega2561 to list.

Attachment: mega_256x_binutils_2.patch
Description: Text Data

Attachment: mega_256x_gcc_2.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]