Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2014 15:36:51 +0200
From:      Oliver Pinter <oliver.pntr@gmail.com>
To:        current@freebsd.org, arch@freebsd.org
Cc:        gavin@freebsd.org, kib@freebsd.org
Subject:   [RFC] remove dead code from link_elf.c
Message-ID:  <CAPjTQNHTiEeSuf9y4Ddriq5Jj7L6yYNSqLujH2ni=XdUF5b-bg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--047d7b33d3c6b8550504f9706375
Content-Type: text/plain; charset=ISO-8859-1

Hi all!

I found that the SPARSE_MAPPING used only in sys/kern/link_elf.c file,
and no other place in kernel, nor in generated codes in /usr/obj/...

op@pandora-d opBSD.git> git grep -i SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING
sys/kern/link_elf.c:#ifdef SPARSE_MAPPING

I proposed to remove the old/dead codes. Patch attached. Tested on amd64.

--047d7b33d3c6b8550504f9706375
Content-Type: application/octet-stream; 
	name="0001-link_elf-remove-SPARSE_MAPPING-and-related-code.patch"
Content-Disposition: attachment; 
	filename="0001-link_elf-remove-SPARSE_MAPPING-and-related-code.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: file0

RnJvbSAwZDBjNzBmNjI5YWUwYzRhYjBjOTkwYTMzZGYzN2UxYTc2NmE4NDIwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucG50ckBnbWFpbC5jb20+
CkRhdGU6IFRodSwgMTUgTWF5IDIwMTQgMTU6MTk6MjQgKzAyMDAKU3ViamVjdDogW1BBVENIXSBs
aW5rX2VsZjogcmVtb3ZlIFNQQVJTRV9NQVBQS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qIFdpcmUgZG93biB0aGUgcGFn
ZXMKLQkJICovCi0JCWVycm9yID0gdm1fbWFwX3dpcmUoa2VybmVsX21hcCwKLQkJICAgICh2bV9v
ZmZzZXRfdCkgc2VnYmFzZSwKLQkJICAgICh2bV9vZmZzZXRfdCkgc2VnYmFzZSArIHNlZ3NbaV0t
PnBfbWVtc3osCi0JCSAgICBWTV9NQVBfV0lSRV9TWVNURU18Vk1fTUFQX1dJUkVfTk9IT0xFUyk7
Ci0JCWlmIChlcnJvciAhPSBLRVJOX1NVQ0NFU1MpIHsKLQkJCWVycm9yID0gRU5PTUVNOwotCQkJ
Z290byBvdXQ7Ci0JCX0KLSNlbmRpZgogCX0KIAogI2lmZGVmIEdQUk9GCkBAIC0xMDg1LDE2ICsx
MDQxLDggQEAgbGlua19lbGZfdW5sb2FkX2ZpbGUobGlua2VyX2ZpbGVfdCBmaWxlKQogCQlyZXR1
cm47CiAJfQogCi0jaWZkZWYgU1BBUlNFX01BUFBJTkcKLQlpZiAoZWYtPm9iamVjdCAhPSBOVUxM
KSB7Ci0JCXZtX21hcF9yZW1vdmUoa2VybmVsX21hcCwgKHZtX29mZnNldF90KSBlZi0+YWRkcmVz
cywKLQkJICAgICh2bV9vZmZzZXRfdCkgZWYtPmFkZHJlc3MKLQkJICAgICsgKGVmLT5vYmplY3Qt
PnNpemUgPDwgUEFHRV9TSElGVCkpOwotCX0KLSNlbHNlCiAJaWYgKGVmLT5hZGRyZXNzICE9IE5V
TEwpCiAJCWZyZWUoZWYtPmFkZHJlc3MsIE1fTElOS0VSKTsKLSNlbmRpZgogCWlmIChlZi0+c3lt
YmFzZSAhPSBOVUxMKQogCQlmcmVlKGVmLT5zeW1iYXNlLCBNX0xJTktFUik7CiAJaWYgKGVmLT5z
dHJiYXNlICE9IE5VTEwpCi0tIAoxLjkuMgoK
--047d7b33d3c6b8550504f9706375--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPjTQNHTiEeSuf9y4Ddriq5Jj7L6yYNSqLujH2ni=XdUF5b-bg>