return 0;
}
+# Whether a target support DT_RELR sections.
+proc supports_dt_relr {} {
+ if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
+ && ([istarget *-*-linux*]
+ || [istarget *-*-gnu*]) } {
+ return 1
+ }
+ return 0
+}
+
# Compare two files line-by-line. FILE_1 is the actual output and FILE_2
# is the expected output. Ignore blank lines in either file.
#
}
if { ![info exists DT_RELR_LDFLAGS] } then {
- if { [istarget "i?86-*-linux*"] \
- || [istarget "x86_64-*-linux*"] \
- || [istarget "i?86-*-gnu**"] } then {
+ if { [supports_dt_relr] } then {
set DT_RELR_LDFLAGS "-z pack-relative-relocs"
} else {
set DT_RELR_LDFLAGS {}
}
if { ![info exists DT_RELR_CC_LDFLAGS] } then {
- if { [istarget "i?86-*-linux*"] \
- || [istarget "x86_64-*-linux*"] \
- || [istarget "i?86-*-gnu**"] } then {
+ if { [supports_dt_relr] } then {
set DT_RELR_CC_LDFLAGS "-Wl,-z,pack-relative-relocs"
} else {
set DT_RELR_CC_LDFLAGS {}
}
if { ![info exists NO_DT_RELR_LDFLAGS] } then {
- if { [istarget "i?86-*-linux*"] \
- || [istarget "x86_64-*-linux*"] \
- || [istarget "i?86-*-gnu**"] } then {
+ if { [supports_dt_relr] } then {
set NO_DT_RELR_LDFLAGS "-z nopack-relative-relocs"
} else {
set NO_DT_RELR_LDFLAGS {}
}
if { ![info exists NO_DT_RELR_CC_LDFLAGS] } then {
- if { [istarget "i?86-*-linux*"] \
- || [istarget "x86_64-*-linux*"] \
- || [istarget "i?86-*-gnu**"] } then {
+ if { [supports_dt_relr] } then {
set NO_DT_RELR_CC_LDFLAGS "-Wl,-z,nopack-relative-relocs"
} else {
set NO_DT_RELR_CC_LDFLAGS {}
#source: dt-relr-1.s
#ld: -e _start $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
There is no dynamic section in this file.
#source: dt-relr-1.s
#ld: -e _start -pie $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
#source: dt-relr-1.s
#ld: -shared $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
#source: dt-relr-2.s
#ld: -e _start $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
There is no dynamic section in this file.
#source: dt-relr-2.s
#ld: -e _start -pie $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+
#source: dt-relr-2.s
#ld: -shared $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+
#source: dt-relr-2.s
#ld: -e _start -pie $DT_RELR_LDFLAGS --no-relax
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+
#source: dt-relr-2.s
#ld: -e _start -pie $DT_RELR_LDFLAGS -z nocombreloc
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+
#source: dt-relr-2.s
#ld: -r $DT_RELR_LDFLAGS
#readelf: -rW
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#...
Relocation section '\.rel(a|)\.data' at offset 0x[0-9a-f]+ contains 5 entries:
#source: dt-relr-2.s
#ld: -e _start -pie $NO_DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
#source: dt-relr-2.s
#ld: -e _start -shared $NO_DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
#source: dt-relr-3.s
#ld: -e _start -pie $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
#source: dt-relr-3.s
#ld: -shared $DT_RELR_LDFLAGS
#readelf: -rW -d
-#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu*
+#target: [supports_dt_relr]
#failif
#...
# MA 02110-1301, USA.
#
-# Linux tests.
-if { ![istarget "*-*-linux*"] } {
+if { ![supports_dt_relr] } {
return
}