From: "D. Bahi" <dbahi@enterasys.com>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: user-mode-linux-user@lists.sourceforge.net
Subject: [uml-devel] PATCH -- Was: link error MODE_SKAS and ! MODE_TT in 2.4.26-2 + uml.sf.net patches
Date: Fri, 06 Aug 2004 16:29:12 -0400 [thread overview]
Message-ID: <4113EA18.3040506@enterasys.com> (raw)
In-Reply-To: <410E5CFA.5000504@enterasys.com>
[-- Attachment #1.1: Type: text/plain, Size: 1840 bytes --]
this patch fixes the unresolved link time error
with a conditional around the definition of CAN_KMALLOC
and removes the unnedded -SEARCH_DIR line from dyn_link.ld.in
(this actually gets in the way if using a non- system toolchain
and it's removal should not affect any properly built toolchain).
--
db
D. Bahi wrote:
> sorry about my own follow up - it's a trivial bug:
>
> rather than wrap CAN_KMALLOC with multiple macro conditionals
> to avoid 'tracing_pid' being referenced i just added the line
>
> int tracing_pid = -1
>
> to arch/um/kern/skas/process.c so that it parallels kern/tt/tracer.c
> this might mask more critical references introduced in the future
> however. so the multiple macro fix would be the proper one i guess...
>
>
> D. Bahi wrote:
>
>> i think this has been like this for some time... as i remember
>> trying to turn of TT completely in earlier releases:
>>
>> CONFIG_MODE_SKAS=y
>> CONFIG_X86_CMPXCHG=y
>> # CONFIG_MODE_TT is not set
>> # CONFIG_STATIC_LINK is not set
>>
>> results in:
>>
>> gcc -Wl,-T,arch/um/dyn_link.ld -Wl,-rpath,/lib -Wl,--wrap,malloc
>> -Wl,--wrap,free -Wl,--wrap,calloc \
>> -o linux arch/um/main.o vmlinux.o -L/usr/lib -lutil
>> arch/um/main.o(.text+0x363): In function `__wrap_malloc':
>> arch/um/main.c:187: undefined reference to `tracing_pid'
>> arch/um/main.o(.text+0x3e2): In function `__wrap_free':
>> arch/um/main.c:231: undefined reference to `tracing_pid'
>> arch/um/main.o(.text+0x425):arch/um/main.c:235: undefined reference to
>> `tracing_pid'
>> collect2: ld returned 1 exit status
>> make: *** [linux] Error 1
>>
>> arch/um/main.c:187 is in void *__wrap_malloc(int size)
>> ==> else ret = um_vmalloc(size);
>>
>> arch/um/main.c:231 and :235 are in void __wrap_free(void *ptr)
>> ==> if(CAN_KMALLOC())
>> ==> if(CAN_KMALLOC())
>>
>
[-- Attachment #1.2: skas_no_tt_dynlink --]
[-- Type: text/plain, Size: 944 bytes --]
--- linux-2.4.26_uml-patch-2.4.26-2um.orig/arch/um/dyn_link.ld.in 2004-08-01 07:52:46.000000000 -0400
+++ linux-2.4.26_uml-patch-2.4.26-2um_incrementals/arch/um/dyn_link.ld.in 2004-08-06 15:48:51.000000000 -0400
@@ -1,7 +1,7 @@
OUTPUT_FORMAT("ELF_FORMAT")
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
-SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
--- linux-2.4.26_uml-patch-2.4.26-2um.orig/arch/um/main.c 2004-08-01 07:52:46.000000000 -0400
+++ linux-2.4.26_uml-patch-2.4.26-2um_incrementals/arch/um/main.c 2004-08-06 15:52:38.000000000 -0400
@@ -171,8 +171,13 @@
return(uml_exitcode);
}
+#ifdef UML_CONFIG_MODE_TT
#define CAN_KMALLOC() \
(kmalloc_ok && CHOOSE_MODE((getpid() != tracing_pid), 1))
+#else
+#define CAN_KMALLOC() \
+ (kmalloc_ok)
+#endif
extern void *__real_malloc(int);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
next parent reply other threads:[~2004-08-06 20:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <410E5994.4060606@enterasys.com>
[not found] ` <410E5CFA.5000504@enterasys.com>
2004-08-06 20:29 ` D. Bahi [this message]
2004-08-09 21:28 ` [uml-devel] PATCH -- Was: link error MODE_SKAS and ! MODE_TT in 2.4.26-2 + uml.sf.net patches Jeff Dike
2004-08-09 22:13 Bahi, David
2004-08-09 23:52 ` Jeff Dike
2004-08-20 12:08 ` BlaisorBlade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4113EA18.3040506@enterasys.com \
--to=dbahi@enterasys.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=user-mode-linux-user@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox