http://sourceware.org/bugzilla/show_bug.cgi?id=13503

             Bug #: 13503
           Summary: [avr] Support RELOCs to represent a byte
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassig...@sourceware.org
        ReportedBy: g...@gcc.gnu.org
                CC: eric.wedding...@atmel.com
    Classification: Unclassified
            Target: avr


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.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to