There's 81 instances of SECTION .text just in libavcodec which I assume aren't getting the use32 FLAT directive.
You may try the following modification:
; aout does not support align=
; NOTE: This section is out of sync with x264, in order to
; keep supporting OS/2.
%macro SECTION_RODATA 0-1 16
%ifidn __OUTPUT_FORMAT__,aout
SECTION .text
%elifidn __OUTPUT_FORMAT__,coff
SECTION .text
%elifidn __OUTPUT_FORMAT__,obj
if %1 = 16
SECTION .rdata align=16 public use32 FLAT class=DATA
%elif
SECTION .rdata align=256 public use32 FLAT class=DATA
%endif
%elifidn __OUTPUT_FORMAT__,win32
SECTION .rdata align=%1
%elif WIN64
SECTION .rdata align=%1
%else
SECTION .rodata align=%1
%endif
%endmacro
after definition this macro in x86inc.asm add:
%ifidn __OUTPUT_FORMAT__,obj
SECTION .text align=4 public use32 FLAT class=CODE
%endif
AFAIK no other changes are necessary.
To check compilation and linking add:
global ps_cos16_1
before
ps_cos16_1: dd 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8, 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8
this way we could come to know if ps_cos16_1 is in proper segment with proper alignment
After compilation I would like to see avcode57.map too