summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-03-10 00:05:04 -0500
committerJohn Koleszar <jkoleszar@google.com>2011-03-10 00:05:04 -0500
commit820b2b927f0909891f2dd6dabce98c63b4b64fe7 (patch)
tree60bb2645c0feeb99a8a3d34dd5f4904995999826 /build
parent0c8bb2f168d1db91dce8c8149f9bda7bc3e0c249 (diff)
parenta0306ea660b2a35d09645e6d3e98d786614a874d (diff)
downloadlibvpx-820b2b927f0909891f2dd6dabce98c63b4b64fe7.tar
libvpx-820b2b927f0909891f2dd6dabce98c63b4b64fe7.tar.gz
libvpx-820b2b927f0909891f2dd6dabce98c63b4b64fe7.tar.bz2
libvpx-820b2b927f0909891f2dd6dabce98c63b4b64fe7.zip
Merge remote branch 'internal/upstream' into HEAD
Diffstat (limited to 'build')
-rwxr-xr-xbuild/make/Makefile2
-rw-r--r--build/make/obj_int_extract.c28
2 files changed, 8 insertions, 22 deletions
diff --git a/build/make/Makefile b/build/make/Makefile
index 40fa6d50c..62d139ea4 100755
--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -153,7 +153,7 @@ endif
#
obj_int_extract: build/make/obj_int_extract.c
$(if $(quiet),echo " [HOSTCC] $@")
- $(qexec)$(HOSTCC) -I. -o $@ $<
+ $(qexec)$(HOSTCC) -I. -I$(SRC_PATH_BARE) -o $@ $<
CLEAN-OBJS += obj_int_extract
#
diff --git a/build/make/obj_int_extract.c b/build/make/obj_int_extract.c
index 26cf45782..22c5cf2ab 100644
--- a/build/make/obj_int_extract.c
+++ b/build/make/obj_int_extract.c
@@ -14,7 +14,7 @@
#include "vpx_config.h"
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW32__)
#include <io.h>
#include <share.h>
#include "vpx/vpx_integer.h"
@@ -816,7 +816,7 @@ bail:
#endif
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW32__)
/* See "Microsoft Portable Executable and Common Object File Format Specification"
for reference.
*/
@@ -830,7 +830,6 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
unsigned int i;
unsigned __int8 *ptr;
unsigned __int32 symoffset;
- FILE *fp;
char **sectionlist; //this array holds all section names in their correct order.
//it is used to check if the symbol is in .bss or .data section.
@@ -871,14 +870,6 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
//log_msg("COFF: raw data pointer ofset for section .data is %u\n", sectionrawdata_ptr);
- fp = fopen("assembly_offsets.asm", "w");
-
- if (fp == NULL)
- {
- perror("open file");
- goto bail;
- }
-
/* The compiler puts the data with non-zero offset in .data section, but puts the data with
zero offset in .bss section. So, if the data in in .bss section, set offset=0.
Note from Wiki: In an object module compiled from C, the bss section contains
@@ -912,13 +903,13 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
char name[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
strncpy(name, ptr, 8);
//log_msg("COFF: Parsing symbol %s\n",name);
- fprintf(fp, "%-40s EQU ", name);
+ printf("%-40s EQU ", name + 1);
}
else
{
//log_msg("COFF: Parsing symbol %s\n",
// buf + strtab_ptr + get_le32(ptr+4));
- fprintf(fp, "%-40s EQU ", buf + strtab_ptr + get_le32(ptr + 4));
+ printf("%-40s EQU ", buf + strtab_ptr + get_le32(ptr + 4) + 1);
}
if (!(strcmp(sectionlist[section-1], ".bss")))
@@ -935,14 +926,13 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg(" Address: %u\n",get_le32(ptr+8));
//log_msg(" Offset: %u\n", symoffset);
- fprintf(fp, "%5d\n", symoffset);
+ printf("%5d\n", symoffset);
}
ptr += 18;
}
- fprintf(fp, " END\n");
- fclose(fp);
+ printf(" END\n");
for (i = 0; i < nsections; i++)
{
@@ -992,11 +982,7 @@ int main(int argc, char **argv)
else
f = argv[1];
- if (_sopen_s(&fd, f, _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE))
- {
- perror("Unable to open file");
- goto bail;
- }
+ fd = _sopen(f, _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
if (_fstat(fd, &stat_buf))
{