1a405f
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
1a405f
# Imported from glibc/Makerules.
1a405f
1a405f
/ld.*[ 	]-E[BL]/b f
1a405f
/collect.*[ 	]-E[BL]/b f
1a405f
/OUTPUT_FORMAT[^)]*$/{N
1a405f
s/\n[	 ]*/ /
1a405f
}
1a405f
t o
1a405f
: o
1a405f
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
1a405f
t q
1a405f
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
1a405f
t s
1a405f
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
1a405f
t q
1a405f
d
1a405f
: s
1a405f
s/"//g
1a405f
G
1a405f
s/\n//
1a405f
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
1a405f
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
1a405f
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
1a405f
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
1a405f
q
1a405f
: q
1a405f
s/"//g
1a405f
p
1a405f
q
1a405f
: f
1a405f
s/^.*[ 	]-E\([BL]\)[ 	].*$/,\1/
1a405f
t h
1a405f
s/^.*[ 	]-E\([BL]\)$/,\1/
1a405f
t h
1a405f
d
1a405f
: h
1a405f
h