Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
c73eb2ff
Commit
c73eb2ff
authored
13 years ago
by
Johann
Browse files
Options
Download
Patches
Plain Diff
Use shared object files for ELF
Fixes #326 Change-Id: I5f2a4257430ef62f674190acefd43a0474821288
parent
d1c0ba8f
v1.14.0-linphone
1.4.X
cayuga
eider
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jkoleszar/cached-multibit
sandbox/jkoleszar/new-rate-control
sandbox/jkoleszar/new-rtcd
sandbox/jkoleszar/reuse-modemv
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
vp9-preview
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
v1.2.0
v1.1.0
v1.0.0
v0.9.7
v0.9.7-p1
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build/make/Makefile
+6
-3
build/make/Makefile
build/make/obj_int_extract.c
+67
-5
build/make/obj_int_extract.c
libs.mk
+26
-3
libs.mk
with
99 additions
and
11 deletions
build/make/Makefile
+
6
−
3
View file @
c73eb2ff
...
@@ -220,11 +220,14 @@ define so_template
...
@@ -220,11 +220,14 @@ define so_template
# for creating them.
# for creating them.
#
#
# This needs further abstraction for dealing with non-GNU linkers.
# This needs further abstraction for dealing with non-GNU linkers.
comma
:=
,
$(1)
:
$(1)
:
$(
if
$(
quiet
)
,@echo
" [LD]
$$
@"
)
$(
if
$(
quiet
)
,@echo
" [LD]
$$
@"
)
$(
qexec
)$$(
LD
)
-shared
$$(
LDFLAGS
)
\
$(
qexec
)$$(
LD
)
-shared
$$(
LDFLAGS
)
\
-Wl
,--no-undefined
-Wl
,-soname,
$$(
SONAME
)
\
-Wl
,--no-undefined
\
-Wl
,--version-script,
$$(
SO_VERSION_SCRIPT
)
-o
$$
@
\
$$(
if
$$(
SONAME
)
,
-Wl
$$(
comma
)
-soname
$$(
comma
)$$(
SONAME
))
\
$$(
if
$$(
SO_VERSION_SCRIPT
)
,
-Wl
$$(
comma
)
--version-script
$$(
comma
)$$(
SO_VERSION_SCRIPT
))
\
-o
$$
@
\
$$(
filter %.o,
$$
?
)
$$(
extralibs
)
$$(
filter %.o,
$$
?
)
$$(
extralibs
)
endef
endef
...
@@ -291,7 +294,7 @@ LIBS=$(call enabled,LIBS)
...
@@ -291,7 +294,7 @@ LIBS=$(call enabled,LIBS)
.libs
:
$(LIBS)
.libs
:
$(LIBS)
@
touch
$@
@
touch
$@
$(
foreach
lib,
$(
filter %_g.a,
$(
LIBS
))
,
$(
eval
$(
call archive_template,
$(
lib
))))
$(
foreach
lib,
$(
filter %_g.a,
$(
LIBS
))
,
$(
eval
$(
call archive_template,
$(
lib
))))
$(
foreach
lib,
$(
filter %so.
$(
VERSION_MAJOR
)
.
$(
VERSION_MINOR
)
.
$(
VERSION_PATCH
)
,
$(
LIBS
))
,
$(
eval
$(
call so_template,
$(
lib
))))
$(
foreach
lib,
$(
filter
%.so
%so.
$(
VERSION_MAJOR
)
.
$(
VERSION_MINOR
)
.
$(
VERSION_PATCH
)
,
$(
LIBS
))
,
$(
eval
$(
call so_template,
$(
lib
))))
INSTALL-LIBS
=
$(
call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS
)
INSTALL-LIBS
=
$(
call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS
)
ifeq
($(MAKECMDGOALS),dist)
ifeq
($(MAKECMDGOALS),dist)
...
...
This diff is collapsed.
Click to expand it.
build/make/obj_int_extract.c
+
67
−
5
View file @
c73eb2ff
...
@@ -347,6 +347,46 @@ bail:
...
@@ -347,6 +347,46 @@ bail:
return
1
;
return
1
;
}
}
int
parse_elf_program
(
elf_obj_t
*
elf
,
int
idx
,
Elf32_Phdr
*
phdr32
,
Elf64_Phdr
*
phdr64
)
{
if
(
phdr32
)
{
if
(
idx
>=
elf
->
hdr32
.
e_phnum
)
goto
bail
;
COPY_STRUCT
(
phdr32
,
elf
->
buf
,
elf
->
hdr32
.
e_phoff
+
idx
*
elf
->
hdr32
.
e_phentsize
,
elf
->
sz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_type
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_offset
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_vaddr
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_paddr
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_filesz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_memsz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_flags
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr32
->
p_align
);
}
else
/* if (phdr64) */
{
if
(
idx
>=
elf
->
hdr64
.
e_phnum
)
goto
bail
;
COPY_STRUCT
(
phdr64
,
elf
->
buf
,
elf
->
hdr64
.
e_phoff
+
idx
*
elf
->
hdr64
.
e_phentsize
,
elf
->
sz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_type
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_offset
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_vaddr
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_paddr
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_filesz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_memsz
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_flags
);
ENDIAN_ASSIGN_IN_PLACE
(
phdr64
->
p_align
);
}
return
0
;
bail:
return
1
;
}
char
*
parse_elf_string_table
(
elf_obj_t
*
elf
,
int
s_idx
,
int
idx
)
char
*
parse_elf_string_table
(
elf_obj_t
*
elf
,
int
s_idx
,
int
idx
)
{
{
if
(
elf
->
bits
==
32
)
if
(
elf
->
bits
==
32
)
...
@@ -411,15 +451,19 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -411,15 +451,19 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
int
i
;
int
i
;
Elf32_Off
strtab_off32
;
Elf32_Off
strtab_off32
;
Elf64_Off
strtab_off64
;
/* save String Table offset for later use */
Elf64_Off
strtab_off64
;
/* save String Table offset for later use */
Elf32_Word
load_alignment32
;
Elf64_Xword
load_alignment64
;
memset
(
&
elf
,
0
,
sizeof
(
elf
));
memset
(
&
elf
,
0
,
sizeof
(
elf
));
elf
.
buf
=
buf
;
elf
.
buf
=
buf
;
elf
.
sz
=
sz
;
elf
.
sz
=
sz
;
/* Parse Header */
if
(
parse_elf_header
(
&
elf
))
if
(
parse_elf_header
(
&
elf
))
goto
bail
;
goto
bail
;
/* Parse Section and Program headers for string table offset and data
* aligment, respectively.
*/
if
(
elf
.
bits
==
32
)
if
(
elf
.
bits
==
32
)
{
{
Elf32_Shdr
shdr
;
Elf32_Shdr
shdr
;
...
@@ -441,6 +485,15 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -441,6 +485,15 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
}
}
}
}
}
}
Elf32_Phdr
phdr
;
for
(
i
=
0
;
i
<
elf
.
hdr32
.
e_phnum
;
i
++
)
{
parse_elf_program
(
&
elf
,
i
,
&
phdr
,
NULL
);
if
(
phdr
.
p_type
==
PT_LOAD
)
{
load_alignment32
=
phdr
.
p_align
;
}
}
}
}
else
/* if (elf.bits == 64) */
else
/* if (elf.bits == 64) */
{
{
...
@@ -463,6 +516,15 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -463,6 +516,15 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
}
}
}
}
}
}
Elf64_Phdr
phdr
;
for
(
i
=
0
;
i
<
elf
.
hdr64
.
e_phnum
;
i
++
)
{
parse_elf_program
(
&
elf
,
i
,
NULL
,
&
phdr
);
if
(
phdr
.
p_type
==
PT_LOAD
)
{
load_alignment64
=
phdr
.
p_align
;
}
}
}
}
/* Parse all Symbol Tables */
/* Parse all Symbol Tables */
...
@@ -473,7 +535,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -473,7 +535,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
{
{
parse_elf_section
(
&
elf
,
i
,
&
shdr
,
NULL
);
parse_elf_section
(
&
elf
,
i
,
&
shdr
,
NULL
);
if
(
shdr
.
sh_type
==
SHT_SYM
TAB
)
if
(
shdr
.
sh_type
==
SHT_
DYN
SYM
)
{
{
for
(
ofst
=
shdr
.
sh_offset
;
for
(
ofst
=
shdr
.
sh_offset
;
ofst
<
shdr
.
sh_offset
+
shdr
.
sh_size
;
ofst
<
shdr
.
sh_offset
+
shdr
.
sh_size
;
...
@@ -520,7 +582,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -520,7 +582,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
}
}
memcpy
(
&
val
,
memcpy
(
&
val
,
elf
.
buf
+
dhdr
.
sh_offset
+
sym
.
st_value
,
elf
.
buf
+
(
sym
.
st_value
-
load_alignment32
)
,
sym
.
st_size
);
sym
.
st_size
);
}
}
...
@@ -565,7 +627,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -565,7 +627,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
{
{
parse_elf_section
(
&
elf
,
i
,
NULL
,
&
shdr
);
parse_elf_section
(
&
elf
,
i
,
NULL
,
&
shdr
);
if
(
shdr
.
sh_type
==
SHT_SYM
TAB
)
if
(
shdr
.
sh_type
==
SHT_
DYN
SYM
)
{
{
for
(
ofst
=
shdr
.
sh_offset
;
for
(
ofst
=
shdr
.
sh_offset
;
ofst
<
shdr
.
sh_offset
+
shdr
.
sh_size
;
ofst
<
shdr
.
sh_offset
+
shdr
.
sh_size
;
...
@@ -612,7 +674,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
...
@@ -612,7 +674,7 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
}
}
memcpy
(
&
val
,
memcpy
(
&
val
,
elf
.
buf
+
dhdr
.
sh_offset
+
sym
.
st_value
,
elf
.
buf
+
(
sym
.
st_value
-
load_alignment64
)
,
sym
.
st_size
);
sym
.
st_size
);
}
}
...
...
This diff is collapsed.
Click to expand it.
libs.mk
+
26
−
3
View file @
c73eb2ff
...
@@ -257,12 +257,27 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
...
@@ -257,12 +257,27 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
#
#
# Calculate platform- and compiler-specific offsets for hand coded assembly
# Calculate platform- and compiler-specific offsets for hand coded assembly
#
#
#
# Parse shared object files for elf, object files for mach-o and coff
#
ifeq
($(TGT_OS), linux)
OIE_LIB
:=
yes
OIE_EXT
:=
.so
else
OIE_EXT
:=
.o
endif
ifeq
($(CONFIG_EXTERNAL_BUILD),)
# Visual Studio uses obj_int_extract.bat
ifeq
($(CONFIG_EXTERNAL_BUILD),)
# Visual Studio uses obj_int_extract.bat
ifeq
($(ARCH_ARM), yes)
ifeq
($(ARCH_ARM), yes)
asm_com_offsets.asm
:
obj_int_extract
asm_com_offsets.asm
:
obj_int_extract
asm_com_offsets.asm
:
$(VP8_PREFIX)common/asm_com_offsets.c
.o
asm_com_offsets.asm
:
$(VP8_PREFIX)common/asm_com_offsets.c
$(OIE_EXT)
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
OBJS-yes
+=
$(
VP8_PREFIX
)
common/asm_com_offsets.c.o
OBJS-yes
+=
$(
VP8_PREFIX
)
common/asm_com_offsets.c.o
ifeq
($(OIE_LIB), yes)
$(VP8_PREFIX)common/asm_com_offsets.c.so
:
$(VP8_PREFIX)common/asm_com_offsets.c.o
LIBS-yes
+=
$(
VP8_PREFIX
)
common/asm_com_offsets.c.so
endif
CLEAN-OBJS
+=
asm_com_offsets.asm
CLEAN-OBJS
+=
asm_com_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_com_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_com_offsets.asm
endif
endif
...
@@ -270,9 +285,13 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),) # Visual Studio uses obj_int_extract.bat
...
@@ -270,9 +285,13 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),) # Visual Studio uses obj_int_extract.bat
ifeq
($(ARCH_ARM)$(ARCH_X86)$(ARCH_X86_64), yes)
ifeq
($(ARCH_ARM)$(ARCH_X86)$(ARCH_X86_64), yes)
ifeq
($(CONFIG_VP8_ENCODER), yes)
ifeq
($(CONFIG_VP8_ENCODER), yes)
asm_enc_offsets.asm
:
obj_int_extract
asm_enc_offsets.asm
:
obj_int_extract
asm_enc_offsets.asm
:
$(VP8_PREFIX)encoder/asm_enc_offsets.c
.o
asm_enc_offsets.asm
:
$(VP8_PREFIX)encoder/asm_enc_offsets.c
$(OIE_EXT)
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
OBJS-yes
+=
$(
VP8_PREFIX
)
encoder/asm_enc_offsets.c.o
OBJS-yes
+=
$(
VP8_PREFIX
)
encoder/asm_enc_offsets.c.o
ifeq
($(OIE_LIB), yes)
$(VP8_PREFIX)encoder/asm_enc_offsets.c.so
:
$(VP8_PREFIX)encoder/asm_enc_offsets.c.o
LIBS-yes
+=
$(
VP8_PREFIX
)
encoder/asm_enc_offsets.c.so
endif
CLEAN-OBJS
+=
asm_enc_offsets.asm
CLEAN-OBJS
+=
asm_enc_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_enc_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_enc_offsets.asm
endif
endif
...
@@ -281,9 +300,13 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),) # Visual Studio uses obj_int_extract.bat
...
@@ -281,9 +300,13 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),) # Visual Studio uses obj_int_extract.bat
ifeq
($(ARCH_ARM), yes)
ifeq
($(ARCH_ARM), yes)
ifeq
($(CONFIG_VP8_DECODER), yes)
ifeq
($(CONFIG_VP8_DECODER), yes)
asm_dec_offsets.asm
:
obj_int_extract
asm_dec_offsets.asm
:
obj_int_extract
asm_dec_offsets.asm
:
$(VP8_PREFIX)decoder/asm_dec_offsets.c
.o
asm_dec_offsets.asm
:
$(VP8_PREFIX)decoder/asm_dec_offsets.c
$(OIE_EXT)
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
./obj_int_extract rvds
$<
$(
ADS2GAS
)
>
$@
OBJS-yes
+=
$(
VP8_PREFIX
)
decoder/asm_dec_offsets.c.o
OBJS-yes
+=
$(
VP8_PREFIX
)
decoder/asm_dec_offsets.c.o
ifeq
($(OIE_LIB), yes)
$(VP8_PREFIX)decoder/asm_dec_offsets.c.so
:
$(VP8_PREFIX)decoder/asm_dec_offsets.c.o
LIBS-yes
+=
$(
VP8_PREFIX
)
decoder/asm_dec_offsets.c.so
endif
CLEAN-OBJS
+=
asm_dec_offsets.asm
CLEAN-OBJS
+=
asm_dec_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_dec_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes))
:
$(BUILD_PFX)asm_dec_offsets.asm
endif
endif
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets