]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix handling of DT_TEXTREL for an object with more than one read-only
authorkib <kib@FreeBSD.org>
Wed, 2 Mar 2016 16:36:24 +0000 (16:36 +0000)
committerkib <kib@FreeBSD.org>
Wed, 2 Mar 2016 16:36:24 +0000 (16:36 +0000)
commita45b6b4d9cfa0c7046106013d930f98c3df904d4
tree4c7171dd11c887faf6dbb1a4729031038557b9d2
parentc859d15d7aaf1efce90fea417657b0236cf0cee0
Fix handling of DT_TEXTREL for an object with more than one read-only
segment.  According to gABI spec, presence of the tag indicates that
dynamic linker must be prepared to handle relocations against any
read-only segment, not only the segment which we, somewhat arbitrary,
declared the text.

For each read-only segment, add write permission before relocs are
processed, and return to the mapping mode requested by the phdr, after
relocs are done.

Reported, tested, and reviewed by: emaste
PR: 207631
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
libexec/rtld-elf/map_object.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h