17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 55aefb655Srie# Common Development and Distribution License (the "License"). 65aefb655Srie# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 2108278a5eSRod Evans 227c478bd9Sstevel@tonic-gate# 2369112eddSAli Bahrami# Copyright 2010 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gateLIBRARY = libld.a 285aefb655SrieVERS = .4 297c478bd9Sstevel@tonic-gate 305aefb655SrieCOMOBJS = debug.o globals.o util.o 315aefb655Srie 325aefb655SrieCOMOBJS32 = args32.o entry32.o exit32.o groups32.o \ 33ba2be530Sab196087 ldentry32.o ldlibs32.o ldmachdep32.o ldmain32.o \ 3469112eddSAli Bahrami libs32.o files32.o map32.o map_core32.o \ 3569112eddSAli Bahrami map_support32.o map_v232.o order32.o outfile32.o \ 3669112eddSAli Bahrami place32.o relocate32.o resolve32.o sections32.o \ 3769112eddSAli Bahrami sunwmove32.o support32.o syms32.o update32.o \ 3869112eddSAli Bahrami unwind32.o version32.o wrap32.o 395aefb655Srie 405aefb655SrieCOMOBJS64 = args64.o entry64.o exit64.o groups64.o \ 41ba2be530Sab196087 ldentry64.o ldlibs64.o ldmachdep64.o ldmain64.o \ 4269112eddSAli Bahrami libs64.o files64.o map64.o map_core64.o \ 4369112eddSAli Bahrami map_support64.o map_v264.o order64.o outfile64.o \ 4469112eddSAli Bahrami place64.o relocate64.o resolve64.o sections64.o \ 4569112eddSAli Bahrami sunwmove64.o support64.o syms64.o update64.o \ 4669112eddSAli Bahrami unwind64.o version64.o wrap64.o 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gateTOOLOBJS = alist.o assfail.o findprime.o string_table.o \ 497c478bd9Sstevel@tonic-gate strhash.o 507c478bd9Sstevel@tonic-gateAVLOBJ = avl.o 515aefb655Srie 52ba2be530Sab196087# Relocation engine objects. These are kept separate from the L_XXX_MACHOBJS 53ba2be530Sab196087# lists below in order to facilitate linting them. 54ba2be530Sab196087G_MACHOBJS32 = doreloc_sparc_32.o doreloc_x86_32.o 55ba2be530Sab196087G_MACHOBJS64 = doreloc_sparc_64.o doreloc_x86_64.o 56ba2be530Sab196087 57ba2be530Sab196087# Target specific objects (sparc/sparcv9) 58ba2be530Sab196087L_SPARC_MACHOBJS32 = machrel.sparc32.o machsym.sparc32.o 59ba2be530Sab196087L_SPARC_MACHOBJS64 = machrel.sparc64.o machsym.sparc64.o 60ba2be530Sab196087 61ba2be530Sab196087# Target specific objects (i386/amd64) 62ba2be530Sab196087E_X86_TOOLOBJS = leb128.o 63ba2be530Sab196087L_X86_MACHOBJS32 = machrel.intel32.o 647e16fca0SAli BahramiL_X86_MACHOBJS64 = machrel.amd64.o 65ba2be530Sab196087 66ba2be530Sab196087 67ba2be530Sab196087# All target specific objects rolled together 68ba2be530Sab196087E_TOOLOBJS = $(E_SPARC_TOOLOBJS) \ 69ba2be530Sab196087 $(E_X86_TOOLOBJS) 70ba2be530Sab196087L_MACHOBJS32 = $(L_SPARC_MACHOBJS32) \ 71ba2be530Sab196087 $(L_X86_MACHOBJS32) 72ba2be530Sab196087L_MACHOBJS64 = $(L_SPARC_MACHOBJS64) \ 73ba2be530Sab196087 $(L_X86_MACHOBJS64) 74ba2be530Sab196087 75ba2be530Sab196087 765aefb655Srie 777c478bd9Sstevel@tonic-gateBLTOBJ = msg.o 787c478bd9Sstevel@tonic-gateELFCAPOBJ = elfcap.o 797c478bd9Sstevel@tonic-gate 805aefb655SrieOBJECTS = $(BLTOBJ) $(G_MACHOBJS32) $(G_MACHOBJS64) \ 815aefb655Srie $(L_MACHOBJS32) $(L_MACHOBJS64) \ 825aefb655Srie $(COMOBJS) $(COMOBJS32) $(COMOBJS64) \ 835aefb655Srie $(TOOLOBJS) $(E_TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ) 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.lib 867c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/sgs/Makefile.com 877c478bd9Sstevel@tonic-gate 88f808c858SrafSRCDIR = ../common 897c478bd9Sstevel@tonic-gate 90*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-value 91*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 92*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 93*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-switch 94*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-char-subscripts 95*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits 96ba2be530Sab196087 97ba2be530Sab196087# Location of the shared relocation engines maintained under usr/src/uts. 98ba2be530Sab196087# 99ba2be530Sab196087KRTLD_I386 = $(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld 100ba2be530Sab196087KRTLD_AMD64 = $(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld 101ba2be530Sab196087KRTLD_SPARC = $(SRCBASE)/uts/$(VAR_PLAT_sparc)/krtld 102ba2be530Sab196087 103ba2be530Sab196087 10410a4fa49SrieCPPFLAGS += -DUSE_LIBLD_MALLOC -I$(SRCBASE)/lib/libc/inc \ 10569112eddSAli Bahrami -I$(SRCBASE)/uts/common/krtld -I$(SRCBASE)/uts/sparc \ 106ba2be530Sab196087 $(VAR_LIBLD_CPPFLAGS) 1075aefb655SrieLDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \ 1085aefb655Srie $(ELFLIBDIR) -lelf $(DLLIB) -lc 1095aefb655Srie 1105aefb655SrieLINTFLAGS += -u -D_REENTRANT 1115aefb655SrieLINTFLAGS64 += -u -D_REENTRANT 1125aefb655Srie 11308278a5eSRod EvansDYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gatenative:= DYNFLAGS += $(CONVLIBDIR) 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gateBLTDEFS = msg.h 1187c478bd9Sstevel@tonic-gateBLTDATA = msg.c 1197c478bd9Sstevel@tonic-gateBLTMESG = $(SGSMSGDIR)/libld 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gateBLTFILES = $(BLTDEFS) $(BLTDATA) $(BLTMESG) 1227c478bd9Sstevel@tonic-gate 123ba2be530Sab196087# Due to cross linking support, every copy of libld contains every message. 124ba2be530Sab196087# However, we keep target specific messages in their own separate files for 125ba2be530Sab196087# organizational reasons. 126ba2be530Sab196087# 1277c478bd9Sstevel@tonic-gateSGSMSGCOM = ../common/libld.msg 1287c478bd9Sstevel@tonic-gateSGSMSGSPARC = ../common/libld.sparc.msg 1297c478bd9Sstevel@tonic-gateSGSMSGINTEL = ../common/libld.intel.msg 130ba2be530Sab196087SGSMSGTARG = $(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL) 1317c478bd9Sstevel@tonic-gateSGSMSGALL = $(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL) 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gateSGSMSGFLAGS1 = $(SGSMSGFLAGS) -m $(BLTMESG) 1347c478bd9Sstevel@tonic-gateSGSMSGFLAGS2 = $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg 1357c478bd9Sstevel@tonic-gate 1365aefb655SrieCHKSRCS = $(SRCBASE)/uts/common/krtld/reloc.h \ 1375aefb655Srie $(COMOBJS32:%32.o=../common/%.c) \ 1385aefb655Srie $(L_MACHOBJS32:%32.o=../common/%.c) \ 139ba2be530Sab196087 $(L_MACHOBJS64:%64.o=../common/%.c) \ 140ba2be530Sab196087 $(KRTLD_I386)/doreloc.c \ 141ba2be530Sab196087 $(KRTLD_AMD64)/doreloc.c \ 142ba2be530Sab196087 $(KRTLD_SPARC)/doreloc.c 1435aefb655Srie 1447c478bd9Sstevel@tonic-gateSRCS = ../common/llib-lld 1457c478bd9Sstevel@tonic-gateLIBSRCS = $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ 1465aefb655Srie $(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ 1475aefb655Srie $(COMOBJS:%.o=../common/%.c) \ 1487c478bd9Sstevel@tonic-gate $(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \ 1495aefb655Srie $(BLTDATA) 1507c478bd9Sstevel@tonic-gate 1515aefb655SrieLINTSRCS = $(LIBSRCS) ../common/lintsup.c 1525aefb655SrieLINTSRCS32 = $(COMOBJS32:%32.o=../common/%.c) \ 1535aefb655Srie $(L_MACHOBJS32:%32.o=../common/%.c) 1545aefb655SrieLINTSRCS64 = $(COMOBJS64:%64.o=../common/%.c) \ 1555aefb655Srie $(L_MACHOBJS64:%64.o=../common/%.c) 1567c478bd9Sstevel@tonic-gate 157ba2be530Sab196087# Add the shared relocation engine source files to the lint 158ba2be530Sab196087# sources and add the necessary command line options to lint them 159ba2be530Sab196087# correctly. Make can't derive the files since the source and object 160ba2be530Sab196087# names are not directly related 161ba2be530Sab196087$(LINTOUT32) := CPPFLAGS += -DDO_RELOC_LIBLD 162ba2be530Sab196087$(LINTOUT64) := CPPFLAGS += -DDO_RELOC_LIBLD -D_ELF64 163ba2be530Sab196087$(LINTLIB32) := CPPFLAGS += -DDO_RELOC_LIBLD 164ba2be530Sab196087$(LINTLIB64) := CPPFLAGS += -DDO_RELOC_LIBLD -D_ELF64 165ba2be530Sab196087LINTSRCS32 += $(KRTLD_I386)/doreloc.c \ 166ba2be530Sab196087 $(KRTLD_SPARC)/doreloc.c 167ba2be530Sab196087LINTSRCS64 += $(KRTLD_AMD64)/doreloc.c \ 168ba2be530Sab196087 $(KRTLD_SPARC)/doreloc.c 169ba2be530Sab196087 1707c478bd9Sstevel@tonic-gateCLEANFILES += $(LINTOUTS) $(BLTFILES) 1717c478bd9Sstevel@tonic-gateCLOBBERFILES += $(DYNLIB) $(LINTLIBS) $(LIBLINKS) 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gateROOTFS_DYNLIB = $(DYNLIB:%=$(ROOTFS_LIBDIR)/%) 174