This is the mail archive of the binutils@sources.redhat.com 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]

arm-wince-pe's objects are incompatible with WinCE linker


Hello all.

I'm trying to create an object file from a C source with the following
function:

 -- begin --
void str_test(void)
{
    NKDbgPrintfW(L"1\r\n");
    NKDbgPrintfW(L"12\r\n");
}
 -- end --


(arm-wince-pe-gcc -fno-leading-underscore -S str_test.c) produces
the following asm output:

 -- begin --
        .file   "str_test.c"
        .section .rdata
        .align  0
LC0:
        .ascii  "1\000\r\000\n\000\000\000"
        .align  0
LC1:
        .ascii  "1\0002\000\r\000\n\000\000\000"
        .text
        .align  0
        .global str_test
str_test:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 1, uses_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {fp, ip, lr, pc}
        sub     fp, ip, #4
        ldr     r0, L2
        bl      NKDbgPrintfW
        ldr     r0, L2+4
        bl      NKDbgPrintfW
        ldmfd   sp, {fp, sp, pc}
L3:
        .align  0
L2:
        .word   LC0
        .word   LC1
 -- end --

Microsoft linker from WinCE 4.2 expects both L2 and L2+4 words to be
zeros in object file. (Actual addresses of LC0 and LC1 strings are
_added_ to L2 and L2+4 words during linking). But L2+4 word contains
value of 8 (offset of LC1 string) instead.

Is there an option to control the behavior of gas in the way MS linker
expects?

If not then it is a bug in gas or bfd. I'm currently trying to determine
the exact place. Any help would be welcome, since I'm not very familiar
with binutils.


P.S.
I'm using latest snapshots of binutils/gcc on linux host for
arm-wince-pe target.


...Bye..Dmitry.


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