mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 19:28:36 +00:00
rtld: rename tls_done to tls_static
The meaning of the flag is that static TLS allocation was done. Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18. Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
a7bca69492
commit
283a4f4097
|
@ -470,7 +470,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* modules. If we run out of space, we generate an
|
||||
* error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error(
|
||||
|
|
|
@ -258,7 +258,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* dynamically loaded modules. If we run out
|
||||
* of space, we generate an error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error("%s: No space available "
|
||||
|
@ -279,7 +279,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* dynamically loaded modules. If we run out
|
||||
* of space, we generate an error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error("%s: No space available "
|
||||
|
|
|
@ -279,7 +279,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache,
|
|||
if (def == NULL)
|
||||
return -1;
|
||||
|
||||
if (!defobj->tls_done && !allocate_tls_offset(obj))
|
||||
if (!defobj->tls_static && !allocate_tls_offset(obj))
|
||||
return -1;
|
||||
|
||||
tmp = (Elf_Addr)def->st_value + defobj->tlsoffset;
|
||||
|
|
|
@ -242,7 +242,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* dynamically loaded modules. If we run out
|
||||
* of space, we generate an error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error("%s: No space available "
|
||||
|
|
|
@ -433,7 +433,7 @@ obj_free(Obj_Entry *obj)
|
|||
{
|
||||
Objlist_Entry *elm;
|
||||
|
||||
if (obj->tls_done)
|
||||
if (obj->tls_static)
|
||||
free_tls_offset(obj);
|
||||
while (obj->needed != NULL) {
|
||||
Needed_Entry *needed = obj->needed;
|
||||
|
|
|
@ -252,7 +252,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj,
|
|||
* modules. If we run out of space, we generate an
|
||||
* error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error("%s: No space available for static "
|
||||
|
|
|
@ -247,7 +247,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj,
|
|||
* modules. If we run out of space, we generate an
|
||||
* error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error("%s: No space available for static "
|
||||
|
|
|
@ -325,7 +325,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* modules. If we run out of space, we generate an
|
||||
* error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error(
|
||||
|
@ -352,7 +352,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
|
|||
* modules. If we run out of space, we generate an
|
||||
* error.
|
||||
*/
|
||||
if (!defobj->tls_done) {
|
||||
if (!defobj->tls_static) {
|
||||
if (!allocate_tls_offset(
|
||||
__DECONST(Obj_Entry *, defobj))) {
|
||||
_rtld_error(
|
||||
|
|
|
@ -5474,11 +5474,11 @@ allocate_tls_offset(Obj_Entry *obj)
|
|||
{
|
||||
size_t off;
|
||||
|
||||
if (obj->tls_done)
|
||||
if (obj->tls_static)
|
||||
return (true);
|
||||
|
||||
if (obj->tlssize == 0) {
|
||||
obj->tls_done = true;
|
||||
obj->tls_static = true;
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
@ -5509,7 +5509,7 @@ allocate_tls_offset(Obj_Entry *obj)
|
|||
|
||||
tls_last_offset = off;
|
||||
tls_last_size = obj->tlssize;
|
||||
obj->tls_done = true;
|
||||
obj->tls_static = true;
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
@ -5885,7 +5885,7 @@ distribute_static_tls(Objlist *list, RtldLockState *lockstate)
|
|||
return;
|
||||
STAILQ_FOREACH(elm, list, link) {
|
||||
obj = elm->obj;
|
||||
if (obj->marker || !obj->tls_done || obj->static_tls_copied)
|
||||
if (obj->marker || !obj->tls_static || obj->static_tls_copied)
|
||||
continue;
|
||||
distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize,
|
||||
obj->tlssize);
|
||||
|
|
|
@ -245,7 +245,7 @@ typedef struct Struct_Obj_Entry {
|
|||
bool traced : 1; /* Already printed in ldd trace output */
|
||||
bool jmpslots_done : 1; /* Already have relocated the jump slots */
|
||||
bool init_done : 1; /* Already have added object to init list */
|
||||
bool tls_done : 1; /* Already allocated offset for static TLS */
|
||||
bool tls_static : 1; /* Already allocated offset for static TLS */
|
||||
bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */
|
||||
bool z_origin : 1; /* Process rpath and soname tokens */
|
||||
bool z_nodelete : 1; /* Do not unload the object and dependencies */
|
||||
|
|
Loading…
Reference in a new issue