NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/52675: crunching binaries improperly removes PaX notes



The following reply was made to PR toolchain/52675; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/52675: crunching binaries improperly removes PaX notes
Date: Thu, 30 Nov 2017 11:14:45 +0100

 In the hope of this being a simple binutils bug, I tried to reproduce it
 with objcopy -R - but that does the correct thing for a simple test case.
 
 On the other hand, crunchgen does not invoke paxctl or anything, just
 a slightly more complex version of objcopy.
 
 My test was the attached asm file, and then:
 
 cc test.s
 objcopy -R .note.demo.second a.out t.out
 readelf -a a.out
 readelf -a t.out
 
 ... and compare the file offsets for the "demo" notes.
 
 Martin
 
 # demo for objcopy bug, should work on all architectures (no real asm
 # in here)
 
 	.section .note.demo.first,"MG",@note,3*4+8+8,comdat
 	.p2align 2
 
 	.long	8
 	.long	8
 	.long	42
 	.ascii	"demo\0\0\0\0"
 	.ascii	"test234\0"
 	.p2align 2
 
 	.section .note.demo.second,"MG",@note,3*4+8+12,comdat
 	.p2align 2
 
 	.long	8
 	.long	12
 	.long	43
 	.ascii	"demo\0\0\0\0"
 	.ascii	"toberemoved\0"
 	.p2align 2
 
 	.section .note.demo.third,"MG",@note,3*4+8+8,comdat
 	.p2align 2
 
 	.long	8
 	.long	8
 	.long	44
 	.ascii	"demo\0\0\0\0"
 	.ascii	"the end\0"
 	.p2align 2
 
 .text
 	.global main
 main:
 	.long 0
 


Home | Main Index | Thread Index | Old Index