Coder Social home page Coder Social logo

objconv's Issues

Error 2052: Unexpected data between symbol table and string

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

Missing parentheses lead to build warnings

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.

Error in Build!

$ g++ -o objconv -O2 src/*.cpp

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]
 };
 ^

$ ls

extras  objconv-instructions.pdf  README.md  src

$ g++ -v

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) 

Documentation contains incorrect letter case for some command-line parameters

"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

gcc compilation error

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 {

  • int a;
  • unsigned int a;^M
    const char * b;
    };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.