This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86 64 bit resources

On Tue, 2012-11-13 at 13:33 -0500, Mike Frysinger wrote:
> On Tuesday 13 November 2012 11:15:09 Jean-Claude Gervais wrote:
> > I need help:
> > 
> > I tried the following command:
> > windres --target=elf64-ia64-little -i resource.rc -o resource.o
> > 
> > But windres complains about not being able to detect the architecture.
> > What is the proper architecture type?
> > 
> > I want to build a native resource object for (uname output):
> > 
> > Linux 3.2.12-gentoo #6 SMP x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @
> > 2.40GHz GenuineIntel GNU/Linux
> > 
> > What is the proper command line so windres will output an object
> > native to this platform?
> your queries don't seem to make sense
> windres is for producing files for Windows, not Linux
> Windows doesn't use ELF, it uses COFF
> ia64 is for Itanium cpus, not for 64bit intel cpus (x86_64)
> -mike
Thanks for the clarification, Mike.

Here's my reasoning: windres is able to encapsulate a binary resource
inside a linkable object-file.

For Windows targets, this permits library functions to read this object
and extract the resources.

My question is this: Can windres do this for other targets than Windows?

More specifically, can it produce a binary resource encapsulated in a
native-object file?

I understand that the routines to read these proposed resources do not
exist for other platforms than Windows x86 but I have developed code
that can navigate and read resource blocks from .res files and I would
like for certain resources to be packaged inside the executable.

The thing stopping me is producing a resource encapsulated inside a (for
example) PPC32 object file and linking it to the native PPC32

I understand that when windres does this for Windows targets, the code
must access this object by obtaining a pointer to it's symbol (.rsrc ?)
and I want to do the same thing but for other targets.

Maybe I don't understand windres completely, that is certain, but it has
options to specify its endian and target, doesn't it?

Doesn't that mean that it can potentially produce an object for whatever
target is input?

Please excuse my ignorance and thank you for your clarifications.

>From you comment, I will try

windres --target=coff-x86-64 -i resource.rc -o resource.o

OK, that DOES work! Thank you very much Mike!

So my question is really this: 
Now that I have a native-format resource object, is there a way to
obtain a pointer to the resource block from the C code? Is the .rsrc
symbol readable? What is its proper c-referenceable name? How would I
prototype it?

Thanks again!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]