Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32969
b: refs/heads/master
c: 0b0bf7a
h: refs/heads/master
i:
  32967: 1a26d1a
v: v3
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Jul 31, 2006
1 parent 181b98c commit 88b7a81
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 072d3d1acb452f4abd8d3d20af661f2e28854b59
refs/heads/master: 0b0bf7a3ccb6f0b38ead71980e79f875046047b7
14 changes: 14 additions & 0 deletions trunk/Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,20 @@ more details, with real examples.
The second argument is optional, and if supplied will be used
if first argument is not supported.

ld-option
ld-option is used to check if $(CC) when used to link object files
supports the given option. An optional second option may be
specified if first option are not supported.

Example:
#arch/i386/kernel/Makefile
vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv)

In the above example vsyscall-flags will be assigned the option
-Wl$(comma)--hash-style=sysv if it is supported by $(CC).
The second argument is optional, and if supplied will be used
if first argument is not supported.

cc-option
cc-option is used to check if $(CC) support a given option, and not
supported to use an optional second option.
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/i386/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ quiet_cmd_syscall = SYSCALL $@

export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)

vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1
vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv)
SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags)

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/i386/kernel/vsyscall.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SECTIONS
. = VDSO_PRELINK + SIZEOF_HEADERS;

.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/ia64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ CPPFLAGS_gate.lds := -P -C -U$(ARCH)
quiet_cmd_gate = GATE $@
cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@

GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1
GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv)
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/ia64/kernel/gate.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SECTIONS
. = GATE_ADDR + SIZEOF_HEADERS;

.hash : { *(.hash) } :readable
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/parisc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ SECTIONS
*(.dynstr)
*(.dynamic)
*(.hash)
*(.gnu.hash)
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/vdso32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))


EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv)
EXTRA_AFLAGS := -D__VDSO32__ -s

obj-y += vdso32_wrapper.o
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ SECTIONS
{
. = VDSO32_LBASE + SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/vdso64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ targets := $(obj-vdso64) vdso64.so
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))

EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv)
EXTRA_AFLAGS := -D__VDSO64__ -s

obj-y += vdso64_wrapper.o
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SECTIONS
{
. = VDSO64_LBASE + SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/ppc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SECTIONS
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) }
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.text : { *(.rel.text) }
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/kernel/dyn.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SECTIONS

/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86_64/ia32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ targets := $(foreach F,sysenter syscall,vsyscall-$F.o vsyscall-$F.so)
# The DSO images are built using a special linker script
quiet_cmd_syscall = SYSCALL $@
cmd_syscall = $(CC) -m32 -nostdlib -shared -s \
$(call ld-option, -Wl$(comma)--hash-style=sysv) \
-Wl,-soname=linux-gate.so.1 -o $@ \
-Wl,-T,$(filter-out FORCE,$^)

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86_64/ia32/vsyscall.lds
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SECTIONS
. = VSYSCALL_BASE + SIZEOF_HEADERS;

.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
Expand Down
7 changes: 7 additions & 0 deletions trunk/scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
echo $(3); fi;)

# ld-option
# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
ld-option = $(shell if $(CC) $(1) \
-nostdlib -o ldtest$$$$.out -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \
rm -f ldtest$$$$.out)

###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
Expand Down

0 comments on commit 88b7a81

Please sign in to comment.