vertis / objconv Goto Github PK
View Code? Open in Web Editor NEWgit mirror of http://www.agner.org/optimize/objconv.zip
Home Page: http://www.agner.org/optimize/
git mirror of http://www.agner.org/optimize/objconv.zip
Home Page: http://www.agner.org/optimize/
I have fat binaries created with Xcode 5.1 for armv7 and armv7s (iOS 7.1).
After extracting object files with lipo
and ar
, if I try to use objconv on them I always get this error.
$objconv old.o new.o
Input file: old.o, output file: new.o
Error 2052: Unexpected data between symbol table and string tableModifying Mach-O Little Endian32 file
Although the build succeeds, the compiler raises warnings. I'll send a PR soon.
nicklarsen@fourier:objconv$ g++ -o objconv -O2 src/*.cpp
src/disasm1.cpp:1135:36: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (s.AddressFieldSize && (s.MFlags & 0x100) || s.ImmediateFieldSize) {
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ ~~
src/disasm1.cpp:1135:36: note: place parentheses around the '&&' expression to silence this warning
if (s.AddressFieldSize && (s.MFlags & 0x100) || s.ImmediateFieldSize) {
^
( )
src/disasm1.cpp:1169:42: warning: '&&' within '||' [-Wlogical-op-parentheses]
|| (TargetType+1 & 0xFE) == 0x0C && (Symbols[SymNewI].Type & 0xFF) > 0x0C) {
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/disasm1.cpp:1169:42: note: place parentheses around the '&&' expression to silence this warning
|| (TargetType+1 & 0xFE) == 0x0C && (Symbols[SymNewI].Type & 0xFF) > 0x0C) {
^
( )
src/disasm1.cpp:2284:29: warning: '&&' within '||' [-Wlogical-op-parentheses]
if ((s.Errors & 0x4000) && ((s.Warnings1 & 0x10000000) || CountErrors > 1)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/disasm1.cpp:2284:29: note: place parentheses around the '&&' expression to silence this warning
if ((s.Errors & 0x4000) && ((s.Warnings1 & 0x10000000) || CountErrors > 1)
^
( )
3 warnings generated.
src/coff.cpp:142:1: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
};
^
src/disasm1.cpp: In member function ‘void CDisassembler::Pass1()’:
src/disasm1.cpp:816:36: warning: narrowing conversion of ‘((CDisassembler*)this)->CDisassembler::Section’ from ‘uint32 {aka unsigned int}’ to ‘int32 {aka int}’ inside { } [-Wnarrowing]
SFunctionRecord fun = {Section, 0, Sections[Section].TotalSize, 0, 0};
^~~~~~~
src/disasm2.cpp:101:1: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
};
^
extras objconv-instructions.pdf README.md src
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC)
Since you are presumably not an alter ego of Agner Fog, you could disable these features on this repository.
or ch, 0FFFFFF80H ; 0806D873 _ 80. CD, 80
ch isn't 32bit, so this should be 'or ch, 80H'.
"Instructions for objconv" file contains the following text:
-fXXX Convert file to format XXX. XXX = COFF, OMF, ELF or MAC.
PE is accepted as a synonym for COFF. The word size, 32 or 64, may be
appended to the name, e.g. ELF64
When I try to use command-line parameter -fOMF (case sensitive) I get an error "Error 2004: Unknown command line option: %sfOMF".
After some attempts I understand that it is correct to type "-fomf" (may be it is right only under Windows, I don't know).
Windows 10, objconv v2.47
src/coff.cpp:142:1: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
The correct fix:
git diff
diff --git a/src/maindef.h b/src/maindef.h
index d95742d..d75aaa5 100644
--- a/src/maindef.h
+++ b/src/maindef.h
@@ -104,7 +104,7 @@ static inline uint32 HighDWord (uint64 x) {
// Structure of integers and char *, used for tables of text strings
struct SIntTxt {
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.