LNK4078 multiple ".rdata" sections found with different attributes

A

Alan Adams

I have seen the various newsgroup responses on "my code now generates
LNK4078" that range from "rebuild all your code under the latest
Microsoft compiler and linker" to "just ignore it". The question I
have is slightly more specific than that.

In the Windows XP DDK, MSVCRT.LIB (July 2001) includes a linker
directive of "/MERGE:.CRT=.rdata". The CRT sections appear to all be
flagged read/write, while every other .rdata section I can find for
the other DDK .LIBs, plus the .LIBs and .OBJs of my own code, are all
read-only.

The MSVCRT.LIB from Visual Studio 6.0 SP6 (circa 2000) and earlier,
and the MSVCRT.LIB from Visual Studio .NET 2003 (March 2003) have this
linker directive as "/MERGE:.CRT=.data". The CRT sections still
appear to be flagged read/write, but so are the other .LIB/.OBJ .data
sections.

(For what it's worth this IS the source of my LNK4078; simply
switching to an MSVCRT.LIB which doesn't try to merge .CRT into .rdata
eliminates the error, without un-using any of the other XP DDK LIBs
I'm linking against.)

My question is simply one of whether anyone knows the functional
reason why the MSVCRT.LIB from the XP DDK used "/MERGE:.CRT=.rdata",
so that I might understand the intention when considering what
resolution steps to take.

Thanks for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top