Suppose the following C code from avr-gcc 4.7: extern const __pgmx char foo; const __pgmx void * pointer = &foo; Notice that __pgmx is not a macro but a new built-in keyword for a named address space that can hold 24-bit pointers. The code from above tries to assembler the address of foo. However, there is *no* way to do that in binutils because the recprective RELOCs like hh8 are not allowed in places they are needed: .global pointer .data .type pointer, @object .size pointer, 3 pointer: .word foo .warning "assembling 24-bit address needs binutils extension for hh8(foo)" .byte 0 ; hh8(foo) avr-gcc emits a "0" to work around that but the code of not correct as the high part of the address will always be 0.
See also respective extensions to avr-gcc: http://gcc.gnu.org/PR49868 http://gcc.gnu.org/PR50931
(In reply to comment #0) > Suppose the following C code from avr-gcc 4.7: > > extern const __pgmx char foo; > const __pgmx void * pointer = &foo; Please notice that the address spaces have been renamed recently and the name for the 3-byte address is __memx now. Thus, if you want to see the missing feature in code compiled from C, the C source now must read: extern const __memx char foo; const __memx void *pointer = &foo; The generated assembler code will be the same, of course, and the feature as described above to support .byte hh8(foo) is still missing.
(In reply to comment #1) > See also respective extensions to avr-gcc: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50931
(In reply to comment #1) > See also respective extensions to avr-gcc: Finally, the right link to the avr-gcc named address space support, including 24-bit pointers: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49868
CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2012-05-11 12:59:24 Modified files: gas : ChangeLog gas/config : tc-avr.c bfd : ChangeLog bfd-in2.h elf32-avr.c libbfd.h reloc.c include/elf : ChangeLog avr.h Log message: PR 13503 * reloc.c: Add new ENUM for BFD_RELOC_AVR_8_LO, BFD_RELOC_AVR_8_HI, BFD_RELOC_AVR_8_HHI. * bfd-in2.h: Regenerate. * libbfd.h: Regenrate. * elf32-avr.c (elf_avr_howto_table): Add entries for R_AVR_8_LO8, R_AVR_8_HI8, R_AVR_8_HHI8. (avr_reloc_map): Add RELOC mappings for R_AVR_8_LO8, R_AVR_8_HI8, R_AVR_8_HHI8. * config/tc-avr.c (exp_mod_pm): Remove variable. (exp_mod_data_t): New typedef. (pexp_mod_data, exp_mod_data): New variables. (avr_parse_cons_expression): Scan through exp_mod_data[] to find data expression modifiers "pm", "gs", "lo8", hi8", "hhi8", "hh8" and set pexp_mod_data accordingly to be used in avr_cons_fix_new. (avr_cons_fix_new): Handle new data expression modifiers shipped in pexp_mod_data. (md_apply_fix): Handle BFD_RELOC_AVR_8_LO, BFD_RELOC_AVR_8_HI, BFD_RELOC_AVR_8_HHI. * elf/avr.h (RELOC_NUMBERS): Add values for R_AVR_8_LO8, R_AVR_8_HI8, R_AVR_8_HHI8. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4727&r2=1.4728 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c.diff?cvsroot=src&r1=1.80&r2=1.81 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5679&r2=1.5680 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/bfd-in2.h.diff?cvsroot=src&r1=1.568&r2=1.569 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-avr.c.diff?cvsroot=src&r1=1.55&r2=1.56 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/libbfd.h.diff?cvsroot=src&r1=1.273&r2=1.274 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/reloc.c.diff?cvsroot=src&r1=1.228&r2=1.229 http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/elf/ChangeLog.diff?cvsroot=src&r1=1.440&r2=1.441 http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/elf/avr.h.diff?cvsroot=src&r1=1.12&r2=1.13
Patch applied.
CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2012-05-16 14:52:16 Modified files: gas : ChangeLog gas/config : tc-avr.c include/elf : ChangeLog avr.h bfd : ChangeLog bfd-in2.h elf32-avr.c libbfd.h reloc.c Log message: PR 13503 * reloc.c: Rename BFD_RELOC_AVR_8_HHI to BFD_RELOC_AVR_8_HLO. * bfd-in2.h: Regenerate. * libbfd.h: Regenrate. * elf32-avr.c (elf_avr_howto_table): Rename R_AVR_8_HHI8 to R_AVR_8_HLO8. (avr_reloc_map): Ditto. * config/tc-avr.c (avr_cons_fix_new): Rename R_AVR_8_HHI8 to R_AVR_8_HLO8. (exp_mod_data) Ditto. And replace "hhi8" with "hlo8". (md_apply_fix): Rename BFD_RELOC_AVR_8_HHI to BFD_RELOC_AVR_8_HLO. * avr.h (RELOC_NUMBERS): Rename R_AVR_8_HHI8 to R_AVR_8_HLO8. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4735&r2=1.4736 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c.diff?cvsroot=src&r1=1.81&r2=1.82 http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/elf/ChangeLog.diff?cvsroot=src&r1=1.443&r2=1.444 http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/elf/avr.h.diff?cvsroot=src&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5687&r2=1.5688 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/bfd-in2.h.diff?cvsroot=src&r1=1.572&r2=1.573 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-avr.c.diff?cvsroot=src&r1=1.56&r2=1.57 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/libbfd.h.diff?cvsroot=src&r1=1.276&r2=1.277 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/reloc.c.diff?cvsroot=src&r1=1.231&r2=1.232
CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2012-06-11 14:26:41 Modified files: gas : ChangeLog gas/config : tc-avr.c Log message: PR 13503 * config/tc-avr.c (exp_mod): Fix typo introduced in 1.82 from 2012-05-16. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4751&r2=1.4752 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c.diff?cvsroot=src&r1=1.82&r2=1.83
CVSROOT: /cvs/src Module name: src Changes by: denisc@sourceware.org 2012-09-11 17:01:00 Modified files: gas : ChangeLog gas/config : tc-avr.h Log message: PR gas/13503 * config/tc-avr.h (TC_VALIDATE_FIX): Skip: BFD_RELOC_AVR_8_LO, BFD_RELOC_AVR_8_HI, BFD_RELOC_AVR_8_HLO. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4826&r2=1.4827 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.h.diff?cvsroot=src&r1=1.18&r2=1.19