@@ -110,6 +110,11 @@ func testMain(m *testing.M) int {
110110 // TODO(crawshaw): can we do better?
111111 cc = append (cc , []string {"-framework" , "CoreFoundation" , "-framework" , "Foundation" }... )
112112 }
113+ if GOOS == "aix" {
114+ // -Wl,-bnoobjreorder is mandatory to keep the same layout
115+ // in .text section.
116+ cc = append (cc , "-Wl,-bnoobjreorder" )
117+ }
113118 libbase := GOOS + "_" + GOARCH
114119 if runtime .Compiler == "gccgo" {
115120 libbase = "gccgo_" + libgodir + "_fPIC"
@@ -318,7 +323,7 @@ func TestSignalForwarding(t *testing.T) {
318323}
319324
320325func TestSignalForwardingExternal (t * testing.T ) {
321- if GOOS == "freebsd" {
326+ if GOOS == "freebsd" || GOOS == "aix" {
322327 t .Skipf ("skipping on %s/%s; signal always goes to the Go runtime" , GOOS , GOARCH )
323328 }
324329 checkSignalForwardingTest (t )
@@ -594,13 +599,15 @@ func TestPIE(t *testing.T) {
594599 t .Fatal (err )
595600 }
596601
597- f , err := elf .Open ("testp" + exeSuffix )
598- if err != nil {
599- t .Fatal ("elf.Open failed: " , err )
600- }
601- defer f .Close ()
602- if hasDynTag (t , f , elf .DT_TEXTREL ) {
603- t .Errorf ("%s has DT_TEXTREL flag" , "testp" + exeSuffix )
602+ if GOOS != "aix" {
603+ f , err := elf .Open ("testp" + exeSuffix )
604+ if err != nil {
605+ t .Fatal ("elf.Open failed: " , err )
606+ }
607+ defer f .Close ()
608+ if hasDynTag (t , f , elf .DT_TEXTREL ) {
609+ t .Errorf ("%s has DT_TEXTREL flag" , "testp" + exeSuffix )
610+ }
604611 }
605612}
606613
0 commit comments