ppc: MakePEF compiles

This commit is contained in:
Wolfgang Thaller 2015-08-30 11:57:07 +02:00
parent 29a774545d
commit 1d0edc1a12
2 changed files with 34 additions and 1 deletions

View File

@ -1 +1,4 @@
set(CMAKE_CXX_FLAGS "--std=c++11 -Wall -Werror=return-type -Wno-multichar")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../CIncludes)
add_executable(MakePEF MakePEF.cc xcoff.h powerpc.h external.h)

View File

@ -4,11 +4,41 @@
#include <vector>
#include <fstream>
#include <set>
#include <string.h>
#include <alloca.h>
#include <assert.h>
#include <CoreServices/CoreServices.h> /* PEFBinaryFormat.h */
#include "powerpc.h"
/* Provide minimal definitions from ConfitionalMacros.h.
* ConditionalMacros.h can't deal with our host C compiler.9
*/
#define __CONDITIONALMACROS__
#define TYPE_BOOL 1
#define EXTERN_API(x) x
#define EXTERN_API_C(x) x
#define CALLBACK_API(ret,name) ret (*name)
#define CALLBACK_API_C(ret,name) ret (*name)
#define ONEWORDINLINE(x)
#define FOUR_CHAR_CODE(x) (x)
/* Definitions for PEF, from Apple's Universal Interfaces */
#include <PEFBinaryFormat.h>
/* Deal with differences between versions of PEFBinaryFormat.h */
#ifndef PEFRelocComposeSetPosition_1st
#define PEFRelocComposeSetPosition_1st(fullOffset) \
( 0xA000 | ((UInt16) (((UInt32)(fullOffset)) >> 16) ) )
#define PEFRelocComposeSetPosition_2nd(fullOffset) \
( (UInt16) ((UInt32)(fullOffset) & 0xFFFF) )
#define PEFRelocComposeLgByImport_1st(fullIndex) \
( 0xA400 | ((UInt16) (((UInt32)(fullIndex)) >> 16) ) )
#define PEFRelocComposeLgByImport_2nd(fullIndex) \
( (UInt16) ((UInt32)(fullIndex) & 0xFFFF) )
#endif
typedef unsigned bfd_size_type;
typedef unsigned bfd_vma;
#define SYMNMLEN 8