Commit Graph

49 Commits

Author SHA1 Message Date
James Almer ebdc5c419a Merge commit '41cf3e3b1ca375962951fde1b90a03b16197d205'
* commit '41cf3e3b1ca375962951fde1b90a03b16197d205':
  arm: Create proper .rdata sections for COFF

Merged-by: James Almer <jamrial@gmail.com>
2019-02-20 14:48:58 -03:00
James Almer b2f32d60ee Merge commit '5584abf69d83169a010aca404cd1cf95c23ad9ef'
* commit '5584abf69d83169a010aca404cd1cf95c23ad9ef':
  arm: Emit .thumb_func directives

Merged-by: James Almer <jamrial@gmail.com>
2019-02-20 13:51:30 -03:00
Martin Storsjö 41cf3e3b1c arm: Create proper .rdata sections for COFF
As .rodata isn't one of the default created sections for COFF, it was
created as a read-write data section. By using the default .rdata
section name for COFF, it automatically becomes a read-only data section.
The existing ".section .rodata" works as intended for ELF though.

This is based on an original patch and diagnose by Tom Tan
<Tom.Tan@microsoft.com>.

Signed-off-by: Martin Storsjö <martin@martin.st>
2019-01-25 23:53:37 +02:00
Martin Storsjö 5584abf69d arm: Emit .thumb_func directives
Prior to Xcode 9.3, the clang built-in assembler didn't support
altmacro, and gas-preprocessor was used for assembling for arm/darwin.

For thumb functions, gas-preprocessor took care of adding the .thumb_func
directives, but when now being able to assemble without gas-preprocessor,
we need to add these directives ourselves.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-10-12 23:25:53 +03:00
James Almer 33bd2b99a1 Merge commit '3a7b4ae62c798edbd82bcd8fef863c74ed2acd4a'
* commit '3a7b4ae62c798edbd82bcd8fef863c74ed2acd4a':
  arm: Produce .const_data instead of .section .rodata for Mach-O

Merged-by: James Almer <jamrial@gmail.com>
2018-03-30 15:48:17 -03:00
Martin Storsjö 3a7b4ae62c arm: Produce .const_data instead of .section .rodata for Mach-O
This is the same combination of .section directives as used in
aarch64/asm.S.

Since Xcode 9.3, the bundled clang supports altmacro and doesn't
require using gas-preprocessor any longer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-03-30 15:49:30 +03:00
James Almer 71bf534dd6 Merge commit '59cee42d7d22530e66a155305389e29679b11f78'
* commit '59cee42d7d22530e66a155305389e29679b11f78':
  arm: Check for the .arch directive in configure

Merged-by: James Almer <jamrial@gmail.com>
2017-10-30 20:04:46 -03:00
Martin Storsjö 59cee42d7d arm: Check for the .arch directive in configure
When targeting windows, the .arch directive isn't available.

So far, when building for windows, we've always used gas-preprocessor,
both when using msvc's armasm and when using clang. Lately, clang/llvm
has implemented the last missing piece (altmacro support) for building
our assembly without gas-preprocessor. This means that we now build
for arm/windows with clang without any extra compatibility layer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-08 14:21:08 +03:00
James Almer d1ee6fb729 Merge commit '6a1ea4ec932f4fc9fdc00ec51ee070b298ddb35f'
* commit '6a1ea4ec932f4fc9fdc00ec51ee070b298ddb35f':
  arm: warn/error on movrelx usage problematic with PIC on ELF

Merged-by: James Almer <jamrial@gmail.com>
2017-04-04 16:04:29 -03:00
Clément Bœsch a0860b0a38 Merge commit '6f9e34baea4f6f484392e4e67f606a0835d07b73'
* commit '6f9e34baea4f6f484392e4e67f606a0835d07b73':
  arm: Check for support for the .fpu directive

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-02-02 11:22:04 +01:00
Janne Grunau 6a1ea4ec93 arm: warn/error on movrelx usage problematic with PIC on ELF
The warning has false positives but our asm does not trigger it. For
new code false positives can only be avoided by changing the register
allocation.
2016-11-24 21:26:22 +01:00
Martin Storsjö 86c5a23ee5 arm: Clear the gp register alias at the end of functions
We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

This is cherry-picked from libav commit
824e8c2840.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2016-11-15 15:10:03 -05:00
Martin Storsjö 824e8c2840 arm: Clear the gp register alias at the end of functions
We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-11-10 14:01:04 +02:00
Martin Storsjö 6f9e34baea arm: Check for support for the .fpu directive
When targeting COFF (windows), clang doesn't support this
directive (while binutils supports it for all targets).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-21 12:52:10 +03:00
Michael Niedermayer 9a1884a10e Merge commit 'dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73'
* commit 'dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73':
  arm: Suppress tags about used cpu arch and extensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-07 19:30:51 +01:00
Martin Storsjö dcae2e32f7 arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-07 17:10:08 +02:00
Michael Niedermayer 16e65419ed Merge commit 'f963f80399deb1a2b44c1bac3af7123e8a0c9e46'
* commit 'f963f80399deb1a2b44c1bac3af7123e8a0c9e46':
  arm: Use .data.rel.ro for const data with relocations

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 11:58:13 +01:00
Martin Storsjö f963f80399 arm: Use .data.rel.ro for const data with relocations
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-09 11:43:25 +02:00
Michael Niedermayer a40c338a00 Merge commit 'd5a55981986ac5d1a31aef3a8d16eaff8534a412'
* commit 'd5a55981986ac5d1a31aef3a8d16eaff8534a412':
  build: check if AS supports the '.func' directive

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-04 12:45:35 +02:00
Janne Grunau d5a5598198 build: check if AS supports the '.func' directive
Not supported by Clang's integrated assembler. Since it just adds
debug information it can safely omitted.
2014-06-03 14:23:03 +02:00
Michael Niedermayer a74bab7079 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 21:35:30 +01:00
Janne Grunau cbddee1cca arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
2014-03-05 14:30:57 +01:00
Michael Niedermayer 53d11f7b2d Merge commit '543156d7518f5e5d731123da066d86278f9fa492'
* commit '543156d7518f5e5d731123da066d86278f9fa492':
  arm: Mark the stack as non-executable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-19 14:07:26 +01:00
Martin Storsjö 543156d751 arm: Mark the stack as non-executable
If linking in an object file without this attribute set, the
linker will assume that an executable stack might be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-02-19 09:57:19 +02:00
Michael Niedermayer a7574a36af Merge commit 'e3fec3f095ab5ea08ee662942d98526aaf5e3635'
* commit 'e3fec3f095ab5ea08ee662942d98526aaf5e3635':
  arm: Add EXTERN_ASM to the .func and .type declarations for exported symbols

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-08 00:49:28 +01:00
Martin Storsjö e3fec3f095 arm: Add EXTERN_ASM to the .func and .type declarations for exported symbols
This makes the generated assembly more internally consistent,
avoiding declaring two labels for the same function (for cases
where EXTERN_ASM is empty) and not declaring a separate unprefixed
label in other cases.

This also makes sure the .func and .type delcarations have the same
prefix. They have previously not been used on the platforms
that have prefixed symbols on arm (iOS), but gas-preprocessor
has recently started using the .func declarations for adding
.thumb_func declarations for such functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-02-07 15:14:06 +02:00
Michael Niedermayer edba54630b Merge commit '5dae4872357613a0b51120b54a4c5221e0ec3f69'
* commit '5dae4872357613a0b51120b54a4c5221e0ec3f69':
  arm: Allow overriding the alignment set in the function macro

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 05:36:56 +01:00
Martin Storsjö 5dae487235 arm: Allow overriding the alignment set in the function macro
The function macro always sets .align 2 before declaring the
function label (since 5c5e1ea3) and always sets the section to
.text (since 278caa6a).

The .align 5 before certain functions, added in fc252eba, were added
before .text and .align were added to the function macro and thus
became useless/unused when the function macro got them.

This restores the original intention, to align the loop entry
points.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-07 19:29:56 +02:00
Michael Niedermayer b7c6d1ed90 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  arm: Only output eabi attributes if building for ELF
  fix scalarproduct_and_madd_int16_altivec() for orders > 16

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-27 08:55:24 +02:00
Martin Storsjö be7952b5c3 arm: Only output eabi attributes if building for ELF
This matches the other eabi attribute in the same file. This is
required in order to build for arm/hardfloat with other object
file formats than ELF.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-27 00:55:33 +03:00
Michael Niedermayer aba1a48cc5 Merge commit 'b326755989b346d0d935e0628e8865f9b2951c30'
* commit 'b326755989b346d0d935e0628e8865f9b2951c30':
  arm: rename ARMVFP config symbol to VFP

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 14:24:16 +01:00
Michael Niedermayer 89c8eaa321 Merge commit '637606de2d2e0af0a9fa2f23f943765d7d7c5cd5'
* commit '637606de2d2e0af0a9fa2f23f943765d7d7c5cd5':
  configure: arm: make _inline arch ext symbols depend on inline_asm
  arm: use HAVE*_INLINE/EXTERNAL macros for conditional compilation

Conflicts:
	configure
	libavcodec/arm/dca.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 14:19:55 +01:00
Mans Rullgard b326755989 arm: rename ARMVFP config symbol to VFP
This is consistent with usual ARM nomenclature as well as with the
VFPV3 and NEON symbols which both lack the ARM prefix.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-12-07 16:54:04 +00:00
Mans Rullgard a7831d509f arm: use HAVE*_INLINE/EXTERNAL macros for conditional compilation
These macros reflect the actual capabilities required here.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-12-07 16:54:03 +00:00
Michael Niedermayer 7e5496fc41 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ARM: use numeric ID for Tag_ABI_align_preserved
  segment: Pass the interrupt callback on to the chained AVFormatContext, too
  ARM: bswap: drop armcc version of av_bswap16()
  ARM: set Tag_ABI_align_preserved in all asm files

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-03 13:35:02 +02:00
Mans Rullgard 51a15ed740 ARM: use numeric ID for Tag_ABI_align_preserved
Some old assemblers still in use do not support named tags.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-03 11:49:55 +01:00
Mans Rullgard 5e826fd65e ARM: set Tag_ABI_align_preserved in all asm files
All our ARM asm preserves alignment so setting this attribute
in a common location is simpler.  This removes numerous warnings
when linking with armcc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-02 19:47:56 +01:00
Michael Niedermayer 032ba74ed2 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ARM: fix Thumb PIC on Apple
  nut: add do {} while (0) to GET_V
  tiffenc: Check av_malloc() results.
  tiffenc: Simplify pixel format setup using AVPixFmtDescriptor.
  Use atexit() instead of defining a custom exit_program() interface.
  msvc: Fix detection of VFW & Avisynth required libs

Conflicts:
	ffmpeg.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	ffserver.c
	libavcodec/tiffenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-02 19:48:54 +02:00
Mans Rullgard 7bda4ed780 ARM: fix Thumb PIC on Apple
LDR with register offset and PC as base register is not available in
the Thumb instruction set so the addition must be done separately.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-02 13:12:33 +01:00
Michael Niedermayer 406cdddbdd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: add forgotten ;
  matroskadec: fix a sanity check.
  matroskadec: only return corrupt packets that actually contain data
  lavf: zero data/size of the packet passed to read_packet().
  ARM: use 2-operand syntax for ADD Rd, PC in Apple PIC code
  ARM: align PIC offset pools to 4 bytes
  ARM: swap source operands in some add instructions
  configure: update tms470 detection for latest version
  lavf probe: prevent codec probe with no data at all seen
  motion_est: fix use of inline on extern functions

Conflicts:
	libavcodec/motion_est_template.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-21 14:44:32 +02:00
Mans Rullgard 8995d34972 ARM: use 2-operand syntax for ADD Rd, PC in Apple PIC code
The Apple assembler refuses to assemble the 3-operand form
in Thumb2 even though it is valid syntax.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-21 07:07:58 +01:00
Mans Rullgard cdb7db5acd ARM: align PIC offset pools to 4 bytes
When building Thumb2 code, the end of a function, where the PIC
offsets are placed, need not be aligned.  Although the values
are only accessed with instructions allowing unaligned addresses,
keeping them aligned is preferable.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-21 07:07:58 +01:00
Mans Rullgard a27a690fac ARM: swap source operands in some add instructions
This allows using a 16-bit opcode when generating Thumb2 code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-20 17:07:18 +01:00
Michael Niedermayer e80cbdbc57 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo: drop unnecessary arguments to hpel_motion()
  mpegvideo: drop 'inline' from some functions
  nellymoserdec: drop support for s16 output.
  bmpdec: only initialize palette for pal8.
  build: Properly remove object files while cleaning
  flacdsp: arm optimised lpc filter
  compat/vsnprintf: return number of bytes required on truncation.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-16 14:55:00 +02:00
Mans Rullgard 7689eea49a flacdsp: arm optimised lpc filter 2012-09-15 23:54:21 +01:00
Michael Niedermayer 5eb353e0cd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  opt/eval: Include mathematics.h for NAN/INFINITY
  mathematics: Don't use division by zero in NAN/INFINITY macros
  wma: Lower the maximum number of channels to 2
  x86: cpu: clean up check for cpuid instruction support
  ARM: generate position independent code to access data symbols

Conflicts:
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-01 22:43:09 +02:00
Mans Rullgard 62634158b7 ARM: generate position independent code to access data symbols
This creates proper position independent code when accessing
data symbols if CONFIG_PIC is set.

References to external symbols should now use the movrelx macro.
Some additional code changes are required since this macro may
need a register to hold the GOT pointer.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-01 11:25:06 +01:00
Michael Niedermayer 7e22514d98 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  float_dsp: ppc: add a separate header for Altivec function prototypes
  ARM: fix float_dsp breakage from d5a7229
  Add a float DSP framework to libavutil
  PPC: Move types_altivec.h and util_altivec.h from libavcodec to libavutil
  ARM: Move asm.S from libavcodec to libavutil
  vc1dsp: mark put/avg_vc1_mspel_mc() always_inline

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-08 23:59:09 +02:00
Justin Ruggles 94d2b0d2fd ARM: Move asm.S from libavcodec to libavutil
This will allow for easier implementation of ARM-optimized functions in
libraries other than libavcodec.
2012-06-08 13:14:38 -04:00