24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Depending on the execution environment of the executable and the targeted<br />

XCOFF format, the following combinations exist:<br />

• 32-bit program manipulating 32-bit XCOFF files.<br />

A 32-bit program that manipulates 32-bit XCOFF files will require no change to<br />

continue to do so with the new header files.<br />

Note: Since the types of some fields are being changed from long to int, code<br />

that takes the address of such a field will result in a compiler warning when<br />

compiled in ANSI mode.<br />

• 32-bit program manipulating 64-bit XCOFF files.<br />

An existing 32-bit program that manipulates 32-bit XCOFF files can be<br />

recompiled to manipulate 64-bit XCOFF files by defining the symbol<br />

__XCOFF64__. Some code changes will be necessary, but the changes with<br />

respect to the file format will be limited to cases where 32-bit XCOFF and<br />

64-bit XCOFF use different constructs. In particular, n_name will not be<br />

defined in struct syment, and use of struct auxent will require changes since<br />

auxiliary symbols are redefined.<br />

• 64-bit program manipulating 32-bit XCOFF files.<br />

An existing 32-bit program that processes 32-bit XCOFF files can be<br />

recompiled to a 64-bit program without change (with respect to the XCOFF<br />

definition) with two exceptions:<br />

• Pointers in the existing XCOFF files will be defined as ints in 64-bit mode.<br />

• Existing header files use preprocessor macro definitions in some cases.<br />

These same macros may no longer exist when compiling in 64-bit mode, so<br />

incidental use of the macros may require a code change.<br />

3.2.3.3 Incomplete aouthdr Structure<br />

Non-executable XCOFF files do not require a full-size auxiliary header. Current<br />

practice defines a short 32-bit auxiliary header that is generated by the compiler<br />

or the linker when the output file is not an executable. A short 64-bit auxiliary<br />

header will not be required by this definition. Applications examining<br />

non-executables must examine f_opthdr in the XCOFF header to determine how<br />

much of the auxiliary header is in the file.<br />

There will be no auxiliary header used for non-executable 64-bit XCOFF files.<br />

Applications needing the fields from the auxiliary header for non-executable<br />

64-bit XCOFF files should use the information in the section headers to generate<br />

these values. The fields where this may be necessary are text, data, and BSS<br />

sizes.<br />

3.2.3.4 XCOFF Magic Number<br />

The calling conventions for 32-bit mode and 64-bit mode are different in detail<br />

because one saves 32-bit General Purpose Registers (GPRs) onto the stack<br />

frame, and the other saves 64-bit GPRs. Calling from a program of one mode to a<br />

subroutine of the other mode is not supported. The linkage editor ld refuses a<br />

request to link programs of differing execution mode.<br />

Because of this, a new magic number has been introduced for 64-bit execution<br />

mode. The primary purpose of the XCOFF magic number is to identify the<br />

associated Application Binary Interface (ABI), which implies a hardware system<br />

48 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!