diff options
author | rie <none@none> | 2008-01-09 08:39:17 -0800 |
---|---|---|
committer | rie <none@none> | 2008-01-09 08:39:17 -0800 |
commit | e38a713ad4e0a9c42f8cccd9350412b2c6ccccdb (patch) | |
tree | 962e46045e702ed521a186f6503a1ad5ecf2002b | |
parent | 8e314a4400960b022e9b9135577c1c0ceebd1e36 (diff) | |
download | illumos-gate-e38a713ad4e0a9c42f8cccd9350412b2c6ccccdb.tar.gz |
PSARC/2008/006: make ld(1) -z combreloc become default behavior
6642769 ld(1) -z combreloc should become default behavior
-rw-r--r-- | usr/src/cmd/sgs/include/libld.h | 7 | ||||
-rw-r--r-- | usr/src/cmd/sgs/libld/common/args.c | 22 | ||||
-rw-r--r-- | usr/src/cmd/sgs/libld/common/libld.msg | 7 | ||||
-rw-r--r-- | usr/src/cmd/sgs/libld/common/relocate.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/sgs/libld/common/sections.c | 11 | ||||
-rw-r--r-- | usr/src/cmd/sgs/libld/common/update.c | 5 | ||||
-rw-r--r-- | usr/src/cmd/sgs/packages/common/SUNWonld-README | 6 |
7 files changed, 40 insertions, 22 deletions
diff --git a/usr/src/cmd/sgs/include/libld.h b/usr/src/cmd/sgs/include/libld.h index 1db1fc425b..9d8318821b 100644 --- a/usr/src/cmd/sgs/include/libld.h +++ b/usr/src/cmd/sgs/include/libld.h @@ -23,7 +23,7 @@ * Copyright (c) 1988 AT&T * All Rights Reserved * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -322,6 +322,9 @@ struct ofl_desc { #define FLG_OF_MAPSYMB 0x000100000000 /* symbolic scope definition seen */ #define FLG_OF_MAPGLOB 0x000200000000 /* global scope definition seen */ +#define FLG_OF_COMREL 0x000400000000 /* -z combreloc set, which enables */ + /* DT_RELACNT tracking, */ +#define FLG_OF_NOCOMREL 0x000800000000 /* -z nocombreloc set */ /* * In the flags1 arena, establish any options that are applicable to archive @@ -345,7 +348,7 @@ struct ofl_desc { #define FLG_OF1_AUTOELM 0x00000400 /* automatically eliminate */ /* unspecified global symbols */ #define FLG_OF1_IGNORE 0x00000800 /* ignore unused dependencies */ -#define FLG_OF1_RELCNT 0x00001000 /* enable DT_RELACNT tracking */ + #define FLG_OF1_TEXTOFF 0x00002000 /* text relocations are ok */ #define FLG_OF1_ABSEXEC 0x00004000 /* -zabsexec set */ #define FLG_OF1_LAZYLD 0x00008000 /* lazy loading of objects enabled */ diff --git a/usr/src/cmd/sgs/libld/common/args.c b/usr/src/cmd/sgs/libld/common/args.c index 5ae61e3f7d..d547d2faf4 100644 --- a/usr/src/cmd/sgs/libld/common/args.c +++ b/usr/src/cmd/sgs/libld/common/args.c @@ -23,7 +23,7 @@ * Copyright (c) 1988 AT&T * All Rights Reserved * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -206,13 +206,24 @@ check_flags(Ofl_desc * ofl, int argc) if (rflag) { if (dflag == SET_UNKNOWN) dflag = SET_FALSE; - if (ofl->ofl_flags1 & FLG_OF1_RELCNT) { + if (ofl->ofl_flags & FLG_OF_COMREL) { + /* + * Combining relocations when building a relocatable + * object isn't allowed. Warn the user, but proceed. + */ eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_ARG_INCOMP), MSG_ORIG(MSG_ARG_R), MSG_ORIG(MSG_ARG_ZCOMBRELOC)); - ofl->ofl_flags1 &= ~FLG_OF1_RELCNT; + ofl->ofl_flags &= ~FLG_OF_COMREL; } ofl->ofl_flags |= FLG_OF_RELOBJ; + } else { + /* + * If the user hasn't explicitly requested that relocations + * not be combined, combine them by default. + */ + if ((ofl->ofl_flags & FLG_OF_NOCOMREL) == 0) + ofl->ofl_flags |= FLG_OF_COMREL; } if (zdflag == SET_TRUE) @@ -1075,7 +1086,10 @@ parseopt_pass1(Ofl_desc *ofl, int argc, char **argv, int *error) ofl->ofl_flags |= FLG_OF_VERBOSE; } else if (strcmp(optarg, MSG_ORIG(MSG_ARG_COMBRELOC)) == 0) { - ofl->ofl_flags1 |= FLG_OF1_RELCNT; + ofl->ofl_flags |= FLG_OF_COMREL; + } else if (strcmp(optarg, + MSG_ORIG(MSG_ARG_NOCOMBRELOC)) == 0) { + ofl->ofl_flags |= FLG_OF_NOCOMREL; } else if (strcmp(optarg, MSG_ORIG(MSG_ARG_NOCOMPSTRTAB)) == 0) { ofl->ofl_flags1 |= FLG_OF1_NCSTTAB; diff --git a/usr/src/cmd/sgs/libld/common/libld.msg b/usr/src/cmd/sgs/libld/common/libld.msg index 7379236387..b26d33776e 100644 --- a/usr/src/cmd/sgs/libld/common/libld.msg +++ b/usr/src/cmd/sgs/libld/common/libld.msg @@ -20,7 +20,7 @@ # # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -131,8 +131,8 @@ \t\t\tarchive members to resolvetweak references from \ \n\t\t\t\archive files\n" @ MSG_ARG_DETAIL_ZAL "\t[-z altexec64]\texecute the 64-bit link-editor\n" -@ MSG_ARG_DETAIL_ZC "\t[-z combreloc]\tcombine multiple relocation \ - sections\n" +@ MSG_ARG_DETAIL_ZC "\t[-z combreloc | nocombreloc]\n\ + combine|do not combine multiple relocation sections\n" @ MSG_ARG_DETAIL_ZNC "\t[-z nocompstrtab]\n\t\t\tdisable compression of \ string tables\n" @ MSG_ARG_DETAIL_ZDFS "\t[-z defs]\tdisallow undefined symbol references\n" @@ -1114,6 +1114,7 @@ @ MSG_ARG_ALLEXTRT "allextract" @ MSG_ARG_DFLEXTRT "defaultextract" @ MSG_ARG_COMBRELOC "combreloc" +@ MSG_ARG_NOCOMBRELOC "nocombreloc" @ MSG_ARG_NODEFAULTLIB "nodefaultlib" @ MSG_ARG_ENDFILTEE "endfiltee" @ MSG_ARG_LD32 "ld32=" diff --git a/usr/src/cmd/sgs/libld/common/relocate.c b/usr/src/cmd/sgs/libld/common/relocate.c index 505de8b9ff..5973d007f3 100644 --- a/usr/src/cmd/sgs/libld/common/relocate.c +++ b/usr/src/cmd/sgs/libld/common/relocate.c @@ -23,7 +23,7 @@ * Copyright (c) 1988 AT&T * All Rights Reserved * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2212,7 +2212,7 @@ ld_reloc_process(Ofl_desc *ofl) if (ld_do_activerelocs(ofl) == S_ERROR) return (S_ERROR); - if ((ofl->ofl_flags1 & FLG_OF1_RELCNT) == 0) { + if ((ofl->ofl_flags & FLG_OF_COMREL) == 0) { /* * Process the relocation sections: * diff --git a/usr/src/cmd/sgs/libld/common/sections.c b/usr/src/cmd/sgs/libld/common/sections.c index 9d90bad446..c47bf723bb 100644 --- a/usr/src/cmd/sgs/libld/common/sections.c +++ b/usr/src/cmd/sgs/libld/common/sections.c @@ -23,7 +23,7 @@ * Copyright (c) 1988 AT&T * All Rights Reserved * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -960,9 +960,8 @@ make_dynamic(Ofl_desc *ofl) FLG_OF_VERNEED) cnt += 2; /* DT_VERNEED & DT_VERNEEDNUM */ - if ((ofl->ofl_flags1 & FLG_OF1_RELCNT) && - ofl->ofl_relocrelcnt) /* RELACOUNT */ - cnt++; + if ((ofl->ofl_flags & FLG_OF_COMREL) && ofl->ofl_relocrelcnt) + cnt++; /* RELACOUNT */ if (flags & FLG_OF_TEXTREL) /* TEXTREL */ cnt++; @@ -1762,7 +1761,7 @@ make_reloc(Ofl_desc *ofl, Os_desc *osp) return (S_ERROR); (void) strcpy(sectname, rel_prefix); (void) strcat(sectname, osp->os_name); - } else if (ofl->ofl_flags1 & FLG_OF1_RELCNT) { + } else if (ofl->ofl_flags & FLG_OF_COMREL) { size = (ofl->ofl_reloccnt - ofl->ofl_reloccntsub) * relsize; sh_flags = SHF_ALLOC; sectname = (char *)MSG_ORIG(MSG_SCN_SUNWRELOC); @@ -2147,7 +2146,7 @@ ld_make_sections(Ofl_desc *ofl) return (S_ERROR); } - if (ofl->ofl_flags1 & FLG_OF1_RELCNT) { + if (ofl->ofl_flags & FLG_OF_COMREL) { /* * If -zcombreloc is enabled then all relocations (except for * the PLT's) are coalesced into a single relocation section. diff --git a/usr/src/cmd/sgs/libld/common/update.c b/usr/src/cmd/sgs/libld/common/update.c index 503415692e..0492e61b4a 100644 --- a/usr/src/cmd/sgs/libld/common/update.c +++ b/usr/src/cmd/sgs/libld/common/update.c @@ -23,7 +23,7 @@ * Copyright (c) 1988 AT&T * All Rights Reserved * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2227,8 +2227,7 @@ update_odynamic(Ofl_desc *ofl) dyn++; } - if ((ofl->ofl_flags1 & FLG_OF1_RELCNT) && - ofl->ofl_relocrelcnt) { + if ((ofl->ofl_flags & FLG_OF_COMREL) && ofl->ofl_relocrelcnt) { dyn->d_tag = M_REL_DT_COUNT; dyn->d_un.d_val = ofl->ofl_relocrelcnt; dyn++; diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README index 69d22eb8d7..da788e445f 100644 --- a/usr/src/cmd/sgs/packages/common/SUNWonld-README +++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README @@ -1,6 +1,6 @@ #ident "%Z%%M% %I% %E% SMI" # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # CDDL HEADER START @@ -1167,7 +1167,7 @@ releases: -------------------------------------------------------------------------------- ------------------------------------- -Solaris 10 TBD (5th Q-update - s10u5) +Solaris 10 508 (5th Q-update - s10u5) ------------------------------------- Bugid Risk Synopsis ================================================================================ @@ -1303,3 +1303,5 @@ Bugid Risk Synopsis 6629404 ld with -z ignore doesn't scale 6626135 elfedit capabilities str->value mapping should come from usr/src/common/elfcap +6642769 ld(1) -z combreloc should become default behavior (D) + PSARC/2008/006: make ld(1) -z combreloc become default behavior |